Skip to content

Instantly share code, notes, and snippets.

View ReubenBond's full-sized avatar
🌞
building

Reuben Bond ReubenBond

🌞
building
View GitHub Profile
trait FancyTrait {
def withContext(method: => () => Unit) = {
// define some context here, like:
val sender = this.sender
// run the method which can see the context
method()
}
}
@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 / Firewall.cs
Created June 22, 2015 23:40
Snippet to open firewall ports in Windows.
// NOTE: Add a COM reference to NetFwTypeLib
namespace Site.Setup
{
using System;
using System.Linq;
using NetFwTypeLib;
/// <summary>
@ReubenBond
ReubenBond / ServiceFabricPropertyManagerMembershipProvider.cs
Created December 22, 2016 21:16
PropertyManager-based Cluster Membership provider for Service Fabric integration in Microsoft Orleans
namespace Microsoft.Orleans.ServiceFabric
{
using System;
using System.Collections.Generic;
using System.Fabric;
using System.Globalization;
using System.Linq;
using System.Net;
using System.Threading.Tasks;
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 / 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 / Benchmarks.md
Last active March 30, 2017 10:37
CowDictionary
|       Method |                           Kind | Items |              Mean |          StdDev |            Median |     Gen 0 | Allocated |
|------------- |------------------------------- |------ |------------------ |---------------- |------------------ |---------- |---------- |
|        Write | CachedReadConcurrentDictionary |  1000 |   225,437.8898 ns |   2,301.2916 ns |   224,307.7639 ns |   19.9219 | 125.19 kB |
| RandomAccess | CachedReadConcurrentDictionary |  1000 |        38.1510 ns |       0.3593 ns |        38.1710 ns |         - |       0 B |
|      ForEach | CachedReadConcurrentDictionary |  1000 |    12,751.5773 ns |     581.2744 ns |    12,767.5491 ns |         - |      48 B |
|    WriteRead | CachedReadConcurrentDictionary |  1000 |        78.9771 ns |       0.9068 ns |        79.0207 ns |         - |       0 B |
|        Write |           ConcurrentDictionary |  1000 |   220,681.6271 ns |   3,044.1570 ns |   220,026.7558 ns |   19.9219 |  125.2 kB |
| RandomAccess |           ConcurrentDic
@ReubenBond
ReubenBond / TransactionExtensions.cs
Last active April 30, 2017 05:51
Taking part in Service Fabric transactions
using System;
using System.Collections.Concurrent;
using System.Fabric.Replication;
using System.Reflection;
using System.Reflection.Emit;
using Microsoft.ServiceFabric.Data;
internal static class TransactionExtensions
{
@ReubenBond
ReubenBond / notes.md
Created May 8, 2017 21:51
version tolerant serialization notes
  • Want a serialization library which:
    • Supports schema evolution (version tolerant)
    • Is suitable for persistence
    • Suports the rich type system of .NET (cyclic references, generics, polymorphism, referential equality)
    • Is fast and compact
    • Requires minimal effort to use
    • Supports safe/stable serialization of types which the user does not have control over and therefore cannot alter (eg, via surrogates)
    • Has a documented wire format
    • Supports serialization/deserialization context, so that we can deserialize GrainReferences using it and have them still have seamless access to the runtime.
  • Core concepts:
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;