Akka.Streams.Actors Namespace |
Class | Description | |
---|---|---|
ActorPublisher |
TBD
| |
ActorPublisherT | 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. | |
ActorPublisherImplT |
TBD
| |
ActorPublisherSubscription |
TBD
| |
ActorSubscriber | 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. | |
ActorSubscriberImplT |
TBD
| |
ActorSubscriberState |
TBD
| |
ActorSubscriberStateState |
TBD
| |
Cancel |
This message is delivered to the ActorPublisherT actor when the stream
subscriber cancels the subscription.
| |
MaxInFlightRequestStrategy | ||
OnComplete |
TBD
| |
OneByOneRequestStrategy |
Requests one more element when remainingRequested is 0, i.e.
* max one element in flight.
| |
OnError |
TBD
| |
OnErrorBlock |
TBD
| |
OnNext |
TBD
| |
OnSubscribe |
TBD
| |
Request |
This message is delivered to the ActorPublisherT actor when the stream
subscriber requests more elements.
| |
SubscribeT |
TBD
| |
SubscriptionTimeoutExceeded |
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.
| |
WatermarkRequestStrategy |
Requests up to the highWatermark when the remainingRequested is
below the lowWatermark. This a good strategy when the actor performs work itself.
| |
ZeroRequestStrategy |
When request is only controlled with manual calls to Request(Int64).
|
Interface | Description | |
---|---|---|
IActorPublisherMessage |
TBD
| |
IActorSubscriberMessage |
TBD
| |
IRequestStrategy |
An ActorSubscriber defines a IRequestStrategy
to control the stream back pressure.
|
Enumeration | Description | |
---|---|---|
LifecycleState |
TBD
|