This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface MessageFormatter | |
{ | |
byte[] Serialize(object message); | |
object Deserialize(byte[] data, Type type); | |
} | |
public class NetDataContractMessageFormatter : MessageFormatter | |
{ | |
private readonly NetDataContractSerializer serializer; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class window.Bus | |
constructor: -> | |
@dispatcher = {} | |
subscribe: (pattern, handler) -> | |
handlers = @dispatcher[pattern] || [] | |
handlers.push handler | |
@dispatcher[pattern] = handlers | |
publish: (e) -> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MessageSpecification : TypedSpecification<MessageSpecification.Result>, HasMessages | |
{ | |
public Action Before; | |
public Action<Bus> Bootstrap = bus => { }; | |
public List<Expression<Func<Result, bool>>> Assertions = new List<Expression<Func<Result, bool>>>(); | |
public Action Finally; | |
public readonly List<Event> Given = new List<Event>(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static Task<DbDataReader> ExecuteReaderAsync(this IDbCommand dbCommand) { | |
var command = dbCommand as DbCommand; | |
if (command == null) throw new ArgumentException("dbCommand"); | |
return command.ExecuteReaderAsync(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"BucketId": "b", | |
"StreamId": "1b42e222-92d6-4242-a528-53a8e61fa524", | |
"StreamRevision": 2, | |
"CommitId": "0b7efcaa-9923-4813-a780-380fb23ad04a", | |
"CommitSequence": 1, | |
"CommitStamp": "2014-08-18T15:36:43.5386215Z", | |
"Headers": { | |
"A header": "A string value", | |
"Another header": 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[DataContract] | |
public class MoneyDto { | |
[DataMember(Order = 1)] public readonly decimal Amount; | |
[DataMember(Order = 2)] public readonly string CurrencyCode; | |
public CurrrencyDto(decimal amount, string currencyCode) { | |
Amount = amount; | |
CurrencyCode = currencyCode; | |
} | |
} | |
[DataContract] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RabbitMQ | |
| | |
| | |
| | |
| | |
My Application's | |
Main Queue | |
/ | \ | |
/ | \ | |
/ | \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class Program { | |
const int ClusterSize = 3; | |
public static void Main(string[] args) { | |
int clusterMemberId = Int32.Parse(args[0]); | |
var options = new StartupOptions { | |
ClusterMemberId = clusterMemberId | |
} | |
ClusterVNode node = options.BuildVNode(ClusterSize); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open System.Linq | |
let isSimpleType (typ:Type) = | |
typ.IsPrimitive || typ.IsEnum || primitiveTypes.Contains typ | |
open System.Collections | |
open System.Reflection | |
let rec private proxy(target : obj) = | |
let maybeTarget = Some target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class RavenTestBase { | |
Task<IDocumentStore> _createDocumentStore; | |
ctor() { | |
var source = new TaskCompletionSource<IDocumentStore>(); | |
_createDocumentStore = source.Task; | |
Task.Run(async () => { | |
var store = InitializeDocumentStore(); |
OlderNewer