/// <summary> /// Create a new instance of the <see cref="QueueSource"/> /// </summary> /// <param name="queue">The queue</param> /// <param name="prefetchCount">The number of messages that should be read from the queue at once</param> /// <param name="pollInterval">The intervall in witch the queue should be polled if it is empty. Default = 10 seconds</param> /// <param name="options">The options for the <see cref="CloudQueue.GetMessagesAsync(int)"/> call</param> public QueueSource(CloudQueue queue, int prefetchCount = 10, TimeSpan?pollInterval = null, GetRequestOptions options = null) { _queue = queue; _prefetchCount = prefetchCount; _options = options ?? new GetRequestOptions(); _pollInterval = pollInterval ?? TimeSpan.FromSeconds(10); Shape = new SourceShape <CloudQueueMessage>(Out); }
/// <summary> /// Creates a <see cref="Source{TOut,TMat}"/> for the Azure Storage Queue /// </summary> /// <param name="queue">The queue</param> /// <param name="prefetchCount">The number of messages that should be read from the queue at once</param> /// <param name="pollInterval">The intervall in witch the queue should be polled if it is empty. Default = 10 seconds</param> /// <param name="options">The options for the <see cref="CloudQueue.GetMessagesAsync(int)"/> call</param> /// <returns>The <see cref="Source{TOut,TMat}"/> for the Azure Storage Queue</returns> public static Source <CloudQueueMessage, NotUsed> Create(CloudQueue queue, int prefetchCount = 10, TimeSpan?pollInterval = null, GetRequestOptions options = null) { return(Source.FromGraph(new QueueSource(queue, prefetchCount, pollInterval, options))); }