public CorrelationToken Transmit(IMessage command) { var token = CorrelationToken.Create(); messages.Enqueue(stream(command, new Message("", $"echo command {token} completed"))); return(token); }
public CorrelationToken Subscribe(IQueueSubscriber <M> Subscriber) { var ct = CorrelationToken.Create(); Subscribers.TryAdd(ct, Subscriber); return(ct); }
CorrelationToken IQueueReceiver.Subscribe(IQueueSubscriber Subscriber) { var ct = CorrelationToken.Create(); Subscribers.TryAdd(ct, Subscriber); return(ct); }
public Option <CorrelationToken> MonitorPath(FolderPath Path) { var token = CorrelationToken.Create(Path); if (FolderIndex.TryAdd(token, new FolderTree(Path))) { FolderIndex.TryFind(token) .OnNone(Notify) .OnSome(tree => { var index = ToMutableIndex(tree); FileIndex.TryAdd(token, index); iter(index.Keys, file => Notify(inform($"Indexed {file}"))); }); } C.Notify(inform($"{AgentRuntimeId} completed indexing {token}")); return(token); }
public CorrelatedTextMessage(string Text, CorrelationToken?CT = null) : base(CT ?? CorrelationToken.Create()) { this.Text = Text; }
protected CorrelatedMessage() { this.CT = CorrelationToken.Create(); }