Click or drag to resize
Akka.NETAkka.Streams.Actors Namespace
Public classActorPublisher
Public classActorPublisherT

Extend this actor to make it a stream publisher that keeps track of the subscription life cycle and requested elements.

Create a IPublisher backed by this actor with CreateT(IActorRef).

It can be attached to a ISubscriber or be used as an input source for a IFlowTOut, TMat. You can only attach one subscriber to this publisher.

The life cycle state of the subscription is tracked with the following boolean members: IsActive, IsCompleted, IsErrorEmitted, and IsCanceled.

You send elements to the stream by calling OnNext(T). You are allowed to send as many elements as have been requested by the stream subscriber. This amount can be inquired with TotalDemand. It is only allowed to use OnNext(T) when IsActiveTotalDemand > 0, otherwise OnNext(T) will throw IllegalStateException.

When the stream subscriber requests more elements the Request message is delivered to this actor, and you can act on that event. The TotalDemand is updated automatically.

When the stream subscriber cancels the subscription the Cancel message is delivered to this actor. After that subsequent calls to OnNext(T) will be ignored.

You can complete the stream by calling OnComplete. After that you are not allowed to call OnNext(T), OnError(Exception) and OnComplete.

You can terminate the stream with failure by calling OnError(Exception). After that you are not allowed to call OnNext(T), OnError(Exception) and OnComplete.

If you suspect that this ActorPublisherT may never get subscribed to, you can override the SubscriptionTimeout method to provide a timeout after which this Publisher should be considered canceled. The actor will be notified when the timeout triggers via an SubscriptionTimeoutExceeded message and MUST then perform cleanup and stop itself.

If the actor is stopped the stream will be completed, unless it was not already terminated with failure, completed or canceled.

Public classActorPublisherImplT
Public classActorPublisherSubscription
Public classActorSubscriber

Extend this actor to make it a stream subscriber with full control of stream back pressure. It will receive OnNext, OnComplete and OnError messages from the stream. It can also receive other, non-stream messages, in the same way as any actor.

Attach the actor as a ISubscriber to the stream with CreateT(IActorRef)

Subclass must define the RequestStrategy to control stream back pressure. After each incoming message the ActorSubscriber will automatically invoke the RequestDemand(Int32) and propagate the returned demand to the stream. The provided WatermarkRequestStrategy is a good strategy if the actor performs work itself. The provided MaxInFlightRequestStrategy is useful if messages are queued internally or delegated to other actors. You can also implement a custom IRequestStrategy or call Request(Int64) manually together with ZeroRequestStrategy or some other strategy. In that case you must also call Request(Int64) when the actor is started or when it is ready, otherwise it will not receive any elements.

Public classActorSubscriberImplT
Public classActorSubscriberState
Public classActorSubscriberStateState
Public classCancel
Public classMaxInFlightRequestStrategy
Requests up to the max and also takes the number of messages that have been queued internally or delegated to other actors into account. Concrete subclass must implement InFlight. It will request elements in minimum batches of the defined BatchSize.
Public classOnComplete
Public classOneByOneRequestStrategy
Requests one more element when remainingRequested is 0, i.e. * max one element in flight.
Public classOnError
Public classOnErrorBlock
Public classOnNext
Public classOnSubscribe
Public classRequest
Public classSubscribeT
Public classSubscriptionTimeoutExceeded
This message is delivered to the ActorPublisherT actor in order to signal the exceeding of an subscription timeout. Once the actor receives this message, this publisher will already be in cancelled state, thus the actor should clean-up and stop itself.
Public classWatermarkRequestStrategy
Requests up to the highWatermark when the remainingRequested is below the lowWatermark. This a good strategy when the actor performs work itself.
Public classZeroRequestStrategy
When request is only controlled with manual calls to Request(Int64).
Public interfaceIActorPublisherMessage
Public interfaceIActorSubscriberMessage
Public interfaceIRequestStrategy
An ActorSubscriber defines a IRequestStrategy to control the stream back pressure.
Public enumerationLifecycleState