コード例 #1
0
        StatelessAzureQueueReader BuildIntake(string name)
        {
            var queue     = _config.CreateQueueClient().GetQueueReference(name);
            var container = _config.CreateBlobClient().GetContainerReference(name);

            var poisonQueue = new Lazy <CloudQueue>(() =>
            {
                var queueReference = _config.CreateQueueClient().GetQueueReference(name + "-poison");
                queueReference.CreateIfNotExist();
                return(queueReference);
            }, LazyThreadSafetyMode.ExecutionAndPublication);

            var reader = new StatelessAzureQueueReader(name, queue, container, poisonQueue, _observer, _streamer, _queueVisibilityTimeout);

            return(reader);
        }
コード例 #2
0
 public static StatelessAzureQueueWriter Create(IAzureStorageConfig config, string name)
 {
     var queue = config.CreateQueueClient().GetQueueReference(name);
     var container = config.CreateBlobClient().GetContainerReference(name);
     var v = new StatelessAzureQueueWriter(container, queue, name);
     v.Init();
     return v;
 }
コード例 #3
0
        public static StatelessAzureQueueWriter Create(IAzureStorageConfig config, string name)
        {
            var queue     = config.CreateQueueClient().GetQueueReference(name);
            var container = config.CreateBlobClient().GetContainerReference(name);
            var v         = new StatelessAzureQueueWriter(container, queue, name);

            v.Init();
            return(v);
        }
コード例 #4
0
ファイル: AzureStorage.cs プロジェクト: JoergEg/lokad-cqrs
        public static StatelessAzureQueueReader BuildIntake(IAzureStorageConfig cfg, string name,
            TimeSpan visibilityTimeout = default(TimeSpan))
        {
            var timeout = visibilityTimeout == default(TimeSpan) ? TimeSpan.FromMinutes(5) : visibilityTimeout;

            var queue = cfg.CreateQueueClient().GetQueueReference(name);

            var container = cfg.CreateBlobClient().GetBlobDirectoryReference("queues-big").GetSubdirectory(name);

            var poisonQueue = new Lazy<CloudQueue>(() =>
                {
                    var queueReference = cfg.CreateQueueClient().GetQueueReference(name + "-poison");
                    queueReference.CreateIfNotExist();
                    return queueReference;
                }, LazyThreadSafetyMode.ExecutionAndPublication);

            var reader = new StatelessAzureQueueReader(name, queue, container, poisonQueue, timeout);
            reader.InitIfNeeded();
            return reader;
        }
コード例 #5
0
 public IQueueWriter GetWriteQueue(string queueName)
 {
     return(_writeQueues.GetOrAdd(queueName, name =>
     {
         var queue = _config.CreateQueueClient().GetQueueReference(name);
         var container = _config.CreateBlobClient().GetContainerReference(name);
         var v = new StatelessAzureQueueWriter(container, queue, name);
         v.Init();
         return v;
     }));
 }
コード例 #6
0
ファイル: AzureStorage.cs プロジェクト: deke/lokad-cqrs
        static StatelessAzureQueueReader BuildIntake(IAzureStorageConfig cfg, string name,
                                                     TimeSpan visibilityTimeout = default(TimeSpan))
        {
            var timeout = visibilityTimeout == default(TimeSpan) ? TimeSpan.FromMinutes(5) : visibilityTimeout;

            var queue = cfg.CreateQueueClient().GetQueueReference(name);

            var container = cfg.CreateBlobClient().GetBlobDirectoryReference("queues-big").GetSubdirectory(name);

            var poisonQueue = new Lazy <CloudQueue>(() =>
            {
                var queueReference = cfg.CreateQueueClient().GetQueueReference(name + "-poison");
                queueReference.CreateIfNotExist();
                return(queueReference);
            }, LazyThreadSafetyMode.ExecutionAndPublication);

            var reader = new StatelessAzureQueueReader(name, queue, container, poisonQueue, timeout);

            reader.InitIfNeeded();
            return(reader);
        }