public static MemoryQueueReader CreateInbox(this NonserializingMemoryStorageConfig storageConfig, params string[] queueNames) { var queues = queueNames .Select(n => storageConfig.Queues.GetOrAdd(n, s => new BlockingCollection <byte[]>())) .ToArray(); return(new MemoryQueueReader(queues, queueNames)); }
public static MessageSender CreateMessageSender(this NonserializingMemoryStorageConfig storageConfig, IEnvelopeStreamer streamer, string queueName) { return(new MessageSender(streamer, CreateQueueWriter(storageConfig, queueName))); }
public static IQueueWriter CreateQueueWriter(this NonserializingMemoryStorageConfig storageConfig, string queueName) { var collection = storageConfig.Queues.GetOrAdd(queueName, s => new BlockingCollection <byte[]>()); return(new MemoryQueueWriter(collection, queueName)); }
/// <summary> /// Creates the simplified nuclear storage wrapper around Atomic storage. /// </summary> /// <param name="dictionary">The dictionary.</param> /// <param name="strategy">The atomic storage strategy.</param> /// <returns></returns> public static NuclearStorage CreateNuclear(this NonserializingMemoryStorageConfig dictionary, IDocumentStrategy strategy) { var container = new NonserializingMemoryDocumentStore(dictionary.Data, strategy); return(new NuclearStorage(container)); }