Skip to content

Instantly share code, notes, and snippets.

View ReubenBond's full-sized avatar
🧊

Reuben Bond ReubenBond

🧊
View GitHub Profile
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Text;
using System.Threading;
using OrleansBenchmarks.Serialization;
namespace OrleansBenchmarks
{
using BenchmarkDotNet.Attributes;
@ReubenBond
ReubenBond / ILFieldBuilder.cs
Created October 12, 2016 01:58
Generating static fields on the fly in C# (for use in other codegen)
using System;
using System.Collections.Concurrent;
using System.Reflection;
using System.Reflection.Emit;
internal class ILFieldBuilder
{
private static readonly AssemblyBuilder AssemblyBuilder =
AssemblyBuilder.DefineDynamicAssembly(
new AssemblyName(nameof(ILFieldBuilder)),
@ReubenBond
ReubenBond / GuidJsonConverter.cs
Created January 7, 2016 10:25
Guid Json Converter for Orleans / Json.NET
using System;
using Newtonsoft.Json;
namespace ServiceCommon.Utilities.Serialization
{
/// <summary>
/// JSON converter for <see cref="Guid"/>.
/// </summary>
public class GuidJsonConverter : JsonConverter
{
@ReubenBond
ReubenBond / OrleansWishList.md
Last active January 19, 2016 09:00
Orleans Roadmap Episode 1: Wish List

Orleans Roadmap Episode 1: Wish List

Documentation Overhaul

Our documentation is relatively poor. We need to make things much more approachable for newcomers & experienced users alike. Beefing up the documentation will be a big effort which will pay dividends. It wouldn't hurt to spice things up with some illustrations/graphics, either.

Event Sourcing

There has been much discussion about this and it is clearly something which many are interested in. See #343.

Geo-distributed clusters/grains

Having a planet-scale service is very desireable, but there are many considerations and potential issues regarding performance, availability, and consistency (oh, right, CAP...).

@ReubenBond
ReubenBond / Program.cs
Last active December 22, 2016 21:37
Perf test for comparing await vs. ContinueWith in Orleans GrainMethodInvokers
using System;
using System.Threading.Tasks;
namespace AwaitVersusContinueWith
{
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using BenchmarkDotNet;
@ReubenBond
ReubenBond / OrleansJsonSerialization.cs
Created November 6, 2015 06:34
Orleans JSON (JObject, etc) Serialization
/// <summary>
/// Provides support for serializing JSON values.
/// </summary>
[RegisterSerializer]
public class OrleansJsonSerialization
{
/// <summary>
/// Initializes static members of the <see cref="OrleansJsonSerialization"/> class.
/// </summary>
static OrleansJsonSerialization()
@ReubenBond
ReubenBond / ObjectTask.cs
Created November 5, 2015 00:06
ObjectTask: movified version of ValueTask for use in generated dispatchers
public struct ObjectTask : IEquatable<ObjectTask>
{
private static object GetResult<TResult>(Task typedTask)
{
return ((Task<TResult>)typedTask).GetAwaiter().GetResult();
}
private static object GetResult(Task untypedTask)
{
untypedTask?.GetAwaiter().GetResult();
@ReubenBond
ReubenBond / Program.cs
Created October 16, 2015 22:02
TestAzureSilo
namespace TestAzureSilo
{
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.Net;
using Orleans;
using Orleans.Runtime;
@ReubenBond
ReubenBond / SerializationCodeGenerator.cs
Created October 16, 2015 21:06
Orleans IL-based Serializer generator (WIP)
namespace Orleans.CodeGeneration
{
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using System.Reflection.Emit;
using System.Runtime.Serialization;