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