public static TValue ReadCurrentValueFromStream <TValue>(this IValueStream <TValue> stream) { var listener = new ConstantValueStreamListener <TValue>(); using var token = stream.AddListener(listener); return(listener.Value); }
public static IValueStreamListenerToken AddListener <TValue>(this IValueStream <TValue> stream, IValueListener <TValue> listener) { return(stream.AddListener(new SingleValueListener <TValue>(listener))); }