public static void SetReceivedMessage(this State<Pipeline> state, ReceivedMessage receivedMessage) { state.Replace(StateKeys.ReceivedMessage, receivedMessage); }
public ReceivedMessage GetMessage() { if (!_journalInitialized) { ReturnJournalMessages(); } lock (_padlock) { var message = Directory.GetFiles(_queueFolder, ExtensionMask).OrderBy(file => new FileInfo(file).CreationTime).FirstOrDefault(); if (string.IsNullOrEmpty(message)) { return null; } ReceivedMessage result; var acknowledgementToken = Path.GetFileName(message); using (var stream = File.OpenRead(message)) { result = new ReceivedMessage(stream.Copy(), acknowledgementToken); } File.Move(message, Path.Combine(_journalFolder, acknowledgementToken)); return result; } }
public static void SetReceivedMessage(this State<ObservablePipeline> state, ReceivedMessage receivedMessage) { state.Replace(StateKeys.ReceivedMessage, receivedMessage); }