public ITemporalStream AddTemporalQueue <T>(string token, string description = null) { ITemporalStream stream = m_streams.GetOrAdd(token, _token => { stream = new TemporalQueue <T>(description); stream.NoObservers += () => { ITemporalStream forNull; m_streams.TryRemove(token, out forNull); }; return(stream); }); return(stream); }
public IDisposable AddTemporalQueueObserver <T>(ITemporalObserver <T> observer, string token, string description = null, int priority = TemporalContextManager.NewTokenPriority) { ITemporalStream stream = m_streams.GetOrAdd(token, _token => { stream = new TemporalQueue <T>(description); stream.NoObservers += () => { ITemporalStream forNull; m_streams.TryRemove(token, out forNull); }; return(stream); }); TemporalContext <T> ctx = new TemporalContext <T>((ITemporalValueSource <T>)stream, observer, priority); return(stream.Subscribe(new TemporalContextHelper <T>(ctx, this))); }
public Unsubscriber(ITemporalObserver <Td> observer, TemporalQueue <Td> queue) { m_observer = observer; m_queue = queue; }