public SubstreamSubscription(IActorRef parent, SubstreamKey substream) { if (ReferenceEquals(parent, null)) { throw new ArgumentNullException(nameof(parent), "Parent actor ref cannot be null"); } Parent = parent; Substream = substream; }
protected SubstreamOutput CreateSubstreamOutput() { var id = new SubstreamKey(NextId()); var cancellable = ScheduleSubscriptionTimeout(Self, new SubstreamSubscriptionTimeout(id)); var output = new SubstreamOutput(id, Self, this, cancellable); _substreamOutputs.Add(output.Key, output); return(output); }
protected override void InvalidateSubstreamOutput(SubstreamKey substream) { if (!ReferenceEquals(_pendingSubstreamOutput, null) && substream == _pendingSubstreamOutput.Key) { _pendingSubstreamOutput = null; NextPhase(_waitNext); } base.InvalidateSubstreamOutput(substream); }
protected void CompleteSubstreamOutput(SubstreamKey substream) { SubstreamOutput output; if (_substreamOutputs.TryGetValue(substream, out output)) { output.Complete(); _substreamOutputs.Remove(substream); } }
protected void CancelSubstreamOutput(SubstreamKey substream) { SubstreamOutput output; if (_substreamOutputs.TryGetValue(substream, out output)) { output.Cancel(); _substreamOutputs.Remove(substream); } }
public SubstreamSubscriptionTimeout(SubstreamKey substream) { Substream = substream; }
public SubstreamSubscribe(SubstreamKey substream, ISubscriber <T> subscriber) { Substream = substream; Subscriber = subscriber; }
public SubstreamCancel(SubstreamKey substream) { Substream = substream; }
public SubstreamRequestMore(SubstreamKey substream, long demand) { Substream = substream; Demand = demand; }
protected virtual void InvalidateSubstreamOutput(SubstreamKey substream) { CancelSubstreamOutput(substream); Pump(); }
public SubstreamOutput(SubstreamKey key, IActorRef actor, IPump pump, ICancelable subscriptionTimeout) : base(actor, pump) { Key = key; SubscriptionTimeout = subscriptionTimeout; _subscription = new SubstreamSubscription(actor, key); }