コード例 #1
0
        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));
        }
コード例 #2
0
 public static MessageSender CreateMessageSender(this NonserializingMemoryStorageConfig storageConfig, IEnvelopeStreamer streamer, string queueName)
 {
     return(new MessageSender(streamer, CreateQueueWriter(storageConfig, queueName)));
 }
コード例 #3
0
        public static IQueueWriter CreateQueueWriter(this NonserializingMemoryStorageConfig storageConfig, string queueName)
        {
            var collection = storageConfig.Queues.GetOrAdd(queueName, s => new BlockingCollection <byte[]>());

            return(new MemoryQueueWriter(collection, queueName));
        }
コード例 #4
0
        /// <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));
        }