Пример #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
 //--- 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);
 }
Пример #4
0
 //--- Constructors ---
 public SqsPollClient(IAwsSqsClient client, TaskTimerFactory timerFactory)
 {
     _client       = client;
     _timerFactory = timerFactory;
 }
Пример #5
0
 public Consumer(string queue, IAwsSqsClient client)
 {
     _queue  = queue;
     _client = client;
 }
Пример #6
0
 public Consumer(string queue, IAwsSqsClient client)
 {
     _queue = queue;
     _client = client;
 }
Пример #7
0
 public static Result <AwsSqsResponse> CreateQueue(this IAwsSqsClient client, string queue, Result <AwsSqsResponse> result)
 {
     return(client.CreateQueue(queue, AwsSqsDefaults.DEFAULT_VISIBILITY, result));
 }
Пример #8
0
 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));
 }
Пример #9
0
 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));
 }
Пример #10
0
 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));
 }