public static bool TryCreate(string serviceId, string serviceSecret, string queueName, bool ensureQueue, out SqsQueue queue) { SqsService service = new SqsService(serviceId, serviceSecret); SqsQueue[] queues = ListQueues(service).ToArray(); foreach (SqsQueue q in queues) { if (q.Name.Equals(queueName, StringComparison.InvariantCultureIgnoreCase)) { queue = q; return true; } } if (ensureQueue) { queue = Create(service, queueName); return true; } queue = null; return false; }
public static bool TryCreate(string serviceId, string serviceSecret, string queueName, bool ensureQueue, out SqsQueue queue) { SqsService service = new SqsService(serviceId, serviceSecret); SqsQueue[] queues = ListQueues(service).ToArray(); foreach (SqsQueue q in queues) { if (q.Name.Equals(queueName, StringComparison.InvariantCultureIgnoreCase)) { queue = q; return(true); } } if (ensureQueue) { queue = Create(service, queueName); return(true); } queue = null; return(false); }
public static IEnumerable<SqsQueue> ListQueues(string serviceId, string serviceSecret) { SqsService service = new SqsService(serviceId, serviceSecret); return ListQueues(service); }
public static SqsQueue Create(string serviceId, string serviceSecret, string queueName) { SqsService service = new SqsService(serviceId, serviceSecret); return Create(service, queueName); }
private SqsQueue(Uri uri, SqsService service) { _uri = uri; _service = service; }
private static IEnumerable<SqsQueue> ListQueues(SqsService service) { return service.Execute(new ListQueuesBuilder()).Descendants(Sqs + "QueueUrl").Select( url => new SqsQueue(new Uri(url.Value + "/"), service)); }
private static SqsQueue Create(SqsService service, string queueName) { return new SqsQueue(new Uri(service.Execute(new CreateQueueBuilder(queueName)).Descendants(Sqs + "QueueUrl").First().Value + "/"), service); }
public static SqsQueue Create(string serviceId, string serviceSecret, string queueName) { SqsService service = new SqsService(serviceId, serviceSecret); return(Create(service, queueName)); }
public static IEnumerable <SqsQueue> ListQueues(string serviceId, string serviceSecret) { SqsService service = new SqsService(serviceId, serviceSecret); return(ListQueues(service)); }
private static SqsQueue Create(SqsService service, string queueName) { return(new SqsQueue(new Uri(service.Execute(new CreateQueueBuilder(queueName)).Descendants(Sqs + "QueueUrl").First().Value + "/"), service)); }
private static IEnumerable <SqsQueue> ListQueues(SqsService service) { return(service.Execute(new ListQueuesBuilder()).Descendants(Sqs + "QueueUrl").Select( url => new SqsQueue(new Uri(url.Value + "/"), service))); }
private SqsQueue(Uri uri, SqsService service) { _uri = uri; _service = service; }