public IEnumerable <FDMessageEnvelope> WaitForMessages(TimeSpan duration) { var timeout = DateTime.UtcNow + duration; FDMessageEnvelope reserved = null; _taken.Clear(); while (DateTime.UtcNow < timeout && null == reserved) { GetMessageNames(); reserved = MaybeReserveOne(); if (null == reserved) { Thread.Sleep(CheckSpan); } } var retval = new List <FDMessageEnvelope>(); while (null != reserved) { retval.Add(reserved); reserved = MaybeReserveOne(); if (null == reserved) { GetMessageNames(); reserved = MaybeReserveOne(); } } return(retval); }
public FDQueueAcknowledge(FDMessageEnvelope message, string bus, string exchange, string queueName) { _message = message; _bus = bus; _exchange = exchange; _queueName = queueName; }