protected bool WaitingExposedPublisher(object message) { if (message is ExposedPublisher) { ExposedPublisher = ((ExposedPublisher)message).Publisher; SubReceive.Become(DownstreamRunning); return(true); } throw new IllegalStateException( $"The first message must be [{typeof (ExposedPublisher)}] but was [{message}]"); }
/// <summary> /// TBD /// </summary> /// <param name="maxBufferSize">TBD</param> /// <param name="initialBufferSize">TBD</param> /// <param name="self">TBD</param> /// <param name="pump">TBD</param> /// <param name="afterShutdown">TBD</param> /// <exception cref="IllegalStateException"> /// This exception is thrown when the first message isn't of type <see cref="ExposedPublisher"/>. /// </exception> public FanoutOutputs(int maxBufferSize, int initialBufferSize, IActorRef self, IPump pump, Action afterShutdown = null) { _self = self; _pump = pump; _afterShutdown = afterShutdown; MaxBufferSize = maxBufferSize; InitialBufferSize = initialBufferSize; NeedsDemand = DefaultOutputTransferStates.NeedsDemand(this); NeedsDemandOrCancel = DefaultOutputTransferStates.NeedsDemandOrCancel(this); SubReceive = new SubReceive(message => { if (!(message is ExposedPublisher publisher)) { throw new IllegalStateException($"The first message must be ExposedPublisher but was {message}"); } ExposedPublisher = publisher.Publisher; SubReceive.Become(DownstreamRunning); return(true); }); }
public ExposedPublisher(IActorPublisher publisher) { Publisher = publisher; }
void IActorOutputBoundary.ExposedPublisher(IActorPublisher publisher) => ExposedPublisher((ActorPublisher <T>)publisher);
public ExposedPublisher(GraphInterpreterShell shell, int id, IActorPublisher publisher) { Shell = shell; Id = id; Publisher = publisher; }