private IObservable <TResponse> GetStream <TResponse>(ResponseFactory <TResponse> factory, BroadcastFlags requiredFlags = BroadcastFlags.None) { if (requiredFlags != BroadcastFlags.None && !BroadcastFlags.HasFlag(requiredFlags)) { SetBroadcastFlags(new SetBroadcastFlagsRequest { BroadcastFlags = BroadcastFlags | requiredFlags }); } return(inStream .Where(x => MatchesPattern(x, factory.ResponsePattern)) .Select(factory.ParseResponseBytes)); }
public void SetBroadcastFlags(SetBroadcastFlagsRequest request) { SendRequestWithoutResponse(request); _ = Task.Run(async() => BroadcastFlags = await GetBroadcastFlags(new BroadcastFlagsRequest { })); }