public QueueBatchConsumer(string source, ISyncQueueDispatcher disp, String readLabelReformatExpression) : base(String.Format("QueueBatchConsumer[{0}]", source)) { srcq = new OpaqueMessageQueue(readLabelReformatExpression) { Name = source }; dst = disp; }
public static Result Dispatch(OpaqueMessageQueue Source, ISyncQueueDispatcher Destination) { var msg = Source.Peek(); if (msg == null) { return(Result.SourceEmpty); } if (!Destination.CanPush) { return(Result.DestinationLocked); } if (!Destination.BeginPush(msg)) { return(Result.DestinationFailure); } if (Destination.WaitCompleted(msg)) { Source.Pop(msg.Id, false); return(Result.Dispatched); } return(Result.DestinationFailure); }