Пример #1
0
 //--- 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);
 }
Пример #2
0
 //--- Constructors ---
 public SqsPollClient(IAwsSqsClient client, TaskTimerFactory timerFactory)
 {
     _client = client;
     _timerFactory = timerFactory;
 }
Пример #3
0
 public Consumer(string queue, IAwsSqsClient client)
 {
     _queue = queue;
     _client = client;
 }