Exemplo n.º 1
0
        public AzurePartitionInbox(StatelessAzureQueueReader[] readers,
            Func<uint, TimeSpan> waiter)
        {
            _readers = readers;
            _waiter = waiter;

            _name = string.Format("Azure Inbox [{0}]", string.Join(",", readers.Select(r => r.Name).ToArray()));
        }
Exemplo n.º 2
0
        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;
        }