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); }
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; }
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); }
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; }
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; })); }
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); }