Namespace Akka.Streams.Actors
Classes
ActorPublisher
TBD
ActorPublisher<T>
Extend this actor to make it a stream publisher that keeps track of the subscription life cycle and requested elements.
Create a Reactive.Streams.IPublisher<T> backed by this actor with Create<T>(IActorRef).
It can be attached to a Reactive.Streams.ISubscriber<T> or be used as an input source for a IFlow<TOut, 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 IsActive TotalDemand > 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 ActorPublisher<T> 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.
ActorPublisherImpl<T>
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 Reactive.Streams.ISubscriber<T> to the stream with Create<T>(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.
ActorSubscriberImpl<T>
TBD
ActorSubscriberState
TBD
ActorSubscriberState.State
TBD
Cancel
This message is delivered to the ActorPublisher<T> actor when the stream subscriber cancels the subscription.
MaxInFlightRequestStrategy
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.
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 ActorPublisher<T> actor when the stream subscriber requests more elements.
Subscribe<T>
TBD
SubscriptionTimeoutExceeded
This message is delivered to the ActorPublisher<T> 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).
Interfaces
IActorPublisherMessage
TBD
IActorSubscriberMessage
TBD
IRequestStrategy
An ActorSubscriber defines a IRequestStrategy to control the stream back pressure.
Enums
LifecycleState
TBD