Interface IBowireStreamSubscriber
- Namespace
- Kuestenlogik.Bowire
- Assembly
- Kuestenlogik.Bowire.dll
#1050 — optional extension for IBowireProtocol implementations whose server streams are subscriptions: an MQTT topic, a Kafka consumer, an actor-system tap. SubscribeAsync(string, string, string, List<string>, Dictionary<string, string>?, CancellationToken) returns once the subscription is in place (the broker acknowledged it, the consumer has its partitions, the tap is registered), so a frame sent after the returned task completes is delivered.
public interface IBowireStreamSubscriber
Remarks
InvokeStreamAsync(string, string, string, List<string>, bool, Dictionary<string, string>?, CancellationToken) subscribes inside the enumerator and says nothing about when it took hold. That is enough for watching a stream; it is not enough for a test that subscribes, then makes something happen and expects the frame it causes: without the handshake the frame can arrive before the subscription and be missed. A flow that expects a frame uses this where the plugin offers it.
Methods
SubscribeAsync(string, string, string, List<string>, Dictionary<string, string>?, CancellationToken)
Subscribe to method's stream and return when the
subscription is in place. Same arguments as
InvokeStreamAsync(string, string, string, List<string>, bool, Dictionary<string, string>?, CancellationToken); cancelling
ct abandons the subscribe, disposing the returned
subscription ends it.
Task<IBowireStreamSubscription> SubscribeAsync(string serverUrl, string service, string method, List<string> jsonMessages, Dictionary<string, string>? metadata = null, CancellationToken ct = default)
Parameters
serverUrlstringservicestringmethodstringjsonMessagesList<string>metadataDictionary<string, string>ctCancellationToken