Skip to content

Instantly share code, notes, and snippets.

View ReubenBond's full-sized avatar
🌞
building

Reuben Bond ReubenBond

🌞
building
View GitHub Profile
using System;
using System.Diagnostics;
namespace Orleans.Runtime
{
/// <summary>
/// Non-allocating stopwatch for timing durations.
/// </summary>
internal struct ValueStopwatch
{
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Orleans;
using Orleans.ApplicationParts;
using Orleans.Configuration;
using System;
using System.Linq;
using Microsoft.Extensions.DependencyInjection;
using Newtonsoft.Json;
using Orleans;
using Orleans.Runtime;
using Orleans.Serialization;
namespace Tester
{
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
<LangVersion>7.3</LangVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Orleans.CodeGenerator.MSBuild" Version="2.1.0">
@ReubenBond
ReubenBond / Program.cs
Created September 19, 2018 02:33
CoreCLR TieredCompilation JIT bug
using System;
namespace TierJit
{
class Program
{
static void Main(string[] args)
{
var array = new byte[] {0x00, 0x01};
var reader = new BinaryTokenStreamReader(array);
@ReubenBond
ReubenBond / BlockingCollection_ConcurrentBag_Issue.cs
Last active July 2, 2018 07:56
Demonstrates an InvalidOperationException when using BlockingCollection with ConcurrentBag as the underlying collection and calling TryTakeFromAny
using System;
using System.Collections.Concurrent;
using System.Threading;
namespace BlockingCollectionConcurrentBagException
{
class Program
{
static void Main(string[] args)
{
@ReubenBond
ReubenBond / GrainObserverManager.cs
Last active December 5, 2017 12:27
Support grains & grain observers
// --------------------------------------------------------------------------------------------------------------------
// <summary>
// Maintains a collection of <see cref="IGrainObserver" /> instances.
// </summary>
// --------------------------------------------------------------------------------------------------------------------
namespace Grains.Utilities
{
using System;
using System.Collections;
@ReubenBond
ReubenBond / VersionTolerantSerializer.md
Last active November 26, 2017 23:16
Proposal for a Version-Tolerant Serializer

Proposal for a Version-Tolerant Serializer

Orleans allows developers to send arbitrary, complex objects between remote processes with little or no prior knowledge of what those object might be. This flexibility & ease-of-use has been key to the success of Orleans, and it's certainly one of our strengths. Ideally, we want to stay out of the way of developers and let them be free to model their applications as they see fit.

Developers build applications with lifetimes ranging in the years and over that time these applications need to evolve. This often means evolving the kinds of objects which are sent between processes or stored and retrieved. One of Orleans' weaknesses is its currently poor support for this kind of evolution. Recently, we've implemented version tolerance for communication interfaces, but we still do not support evolution for object schemas.

Existing serialization libraries which support version tolerance tend to restrict how data is modelled, usually by providing a very restricted type sy

### Keybase proof
I hereby claim:
* I am reubenbond on github.
* I am reubenbond (https://keybase.io/reubenbond) on keybase.
* I have a public key ASCrV546-58t4XtSgwI9FTTzWNy2FpBV7scVBX7Qsdkq_Qo
To claim this, I am signing this object:
namespace ServiceCommon.Utilities
{
using System;
using System.Collections;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Orleans.Runtime;