Class 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.
Implements
Inherited Members
Namespace: Akka.Streams.Actors
Assembly: Akka.Streams.dll
Syntax
public abstract class ActorSubscriber : ActorBase, IInternalActor
Properties
| Improve this Doc View SourceIsCanceled
TBD
Declaration
public bool IsCanceled { get; }
Property Value
Type | Description |
---|---|
Boolean |
RemainingRequested
The number of stream elements that have already been requested from upstream but not yet received.
Declaration
protected int RemainingRequested { get; }
Property Value
Type | Description |
---|---|
Int32 |
RequestStrategy
TBD
Declaration
public abstract IRequestStrategy RequestStrategy { get; }
Property Value
Type | Description |
---|---|
IRequestStrategy |
Methods
| Improve this Doc View SourceAroundPostRestart(Exception, Object)
TBD
Declaration
public override void AroundPostRestart(Exception cause, object message)
Parameters
Type | Name | Description |
---|---|---|
Exception | cause | TBD |
Object | message | TBD |
Overrides
| Improve this Doc View SourceAroundPostStop()
TBD
Declaration
public override void AroundPostStop()
Overrides
| Improve this Doc View SourceAroundPreRestart(Exception, Object)
TBD
Declaration
public override void AroundPreRestart(Exception cause, object message)
Parameters
Type | Name | Description |
---|---|---|
Exception | cause | TBD |
Object | message | TBD |
Overrides
| Improve this Doc View SourceAroundPreStart()
TBD
Declaration
public override void AroundPreStart()
Overrides
| Improve this Doc View SourceAroundReceive(Receive, Object)
TBD
Declaration
protected override bool AroundReceive(Receive receive, object message)
Parameters
Type | Name | Description |
---|---|---|
Receive | receive | TBD |
Object | message | TBD |
Returns
Type | Description |
---|---|
Boolean | TBD |
Overrides
| Improve this Doc View SourceCancel()
Cancel upstream subscription. No more elements will be delivered after cancel.
The ActorSubscriber will be stopped immediately after signaling cancellation. In case the upstream subscription has not yet arrived the Actor will stay alive until a subscription arrives, cancel it and then stop itself.
Declaration
protected void Cancel()
Create<T>(IActorRef)
Attach a ActorSubscriber actor as a Reactive.Streams.ISubscriber<T> to a Reactive.Streams.IPublisher<T> or IFlow<TOut, TMat>
Declaration
public static ISubscriber<T> Create<T>(IActorRef ref)
Parameters
Type | Name | Description |
---|---|---|
IActorRef | ref | TBD |
Returns
Type | Description |
---|---|
Reactive.Streams.ISubscriber<T> | TBD |
Type Parameters
Name | Description |
---|---|
T | TBD |
Request(Int64)
Request a number of elements from upstream.
Declaration
protected void Request(long n)
Parameters
Type | Name | Description |
---|---|---|
Int64 | n | TBD |