//--- Constructors --- public Listener(string queuename, Action <AwsSqsMessage> callback, IAwsSqsClient client, TaskTimerFactory timerFactory, TimeSpan interval) { _queuename = queuename; _callback = callback; _client = client; _cache = new ExpiringHashSet <string>(timerFactory); _cacheTimer = ((interval.TotalSeconds * 2 < 60) ? 60 : interval.TotalSeconds * 2 + 1).Seconds(); _pollTimer = timerFactory.New(tt => Coroutine.Invoke(PollSqs, new Result()).WhenDone(r => _pollTimer.Change(interval, TaskEnv.None)), null); _pollTimer.Change(0.Seconds(), TaskEnv.None); }
//--- Constructors --- public SqsPollClient(IAwsSqsClient client, TaskTimerFactory timerFactory) { _client = client; _timerFactory = timerFactory; }
//--- Constructors --- public Listener(string queuename, Action<AwsSqsMessage> callback, IAwsSqsClient client, TaskTimerFactory timerFactory, TimeSpan interval) { _queuename = queuename; _callback = callback; _client = client; _cache = new ExpiringHashSet<string>(timerFactory); _cacheTimer = ((interval.TotalSeconds * 2 < 60) ? 60 : interval.TotalSeconds * 2 + 1).Seconds(); _pollTimer = timerFactory.New(tt => Coroutine.Invoke(PollSqs, new Result()).WhenDone(r => _pollTimer.Change(interval, TaskEnv.None)), null); _pollTimer.Change(0.Seconds(), TaskEnv.None); }
public Consumer(string queue, IAwsSqsClient client) { _queue = queue; _client = client; }
public static Result <AwsSqsResponse> CreateQueue(this IAwsSqsClient client, string queue, Result <AwsSqsResponse> result) { return(client.CreateQueue(queue, AwsSqsDefaults.DEFAULT_VISIBILITY, result)); }
public static Result <IEnumerable <AwsSqsMessage> > ReceiveMax(this IAwsSqsClient client, string queue, TimeSpan visibilityTimeout, Result <IEnumerable <AwsSqsMessage> > result) { return(client.Receive(queue, AwsSqsDefaults.MAX_MESSAGES, visibilityTimeout, result)); }
public static Result <IEnumerable <AwsSqsMessage> > ReceiveMax(this IAwsSqsClient client, string queue, Result <IEnumerable <AwsSqsMessage> > result) { return(client.Receive(queue, AwsSqsDefaults.MAX_MESSAGES, AwsSqsDefaults.DEFAULT_VISIBILITY, result)); }
public static Result <IEnumerable <AwsSqsMessage> > Receive(this IAwsSqsClient client, string queue, int maxMessages, Result <IEnumerable <AwsSqsMessage> > result) { return(client.Receive(queue, maxMessages, AwsSqsDefaults.DEFAULT_VISIBILITY, result)); }