ActorSubscriber Class |
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.
Namespace: Akka.Streams.Actors
The ActorSubscriber type exposes the following members.
Name | Description | |
---|---|---|
ActorSubscriber | Initializes a new instance of the ActorSubscriber class |
Name | Description | |
---|---|---|
IsCanceled |
TBD
| |
RemainingRequested |
The number of stream elements that have already been requested from upstream
but not yet received.
| |
RequestStrategy |
TBD
| |
Self |
Gets the self ActorRef
(Inherited from ActorBase.) | |
Sender |
Gets the sending ActorRef of the current message
(Inherited from ActorBase.) |
Name | Description | |
---|---|---|
AroundPostRestart |
TBD
(Overrides ActorBaseAroundPostRestart(Exception, Object).) | |
AroundPostStop |
TBD
(Overrides ActorBaseAroundPostStop.) | |
AroundPreRestart |
TBD
(Overrides ActorBaseAroundPreRestart(Exception, Object).) | |
AroundPreStart |
TBD
(Overrides ActorBaseAroundPreStart.) | |
AroundReceive |
TBD
(Overrides ActorBaseAroundReceive(Receive, Object).) | |
Become |
Changes the actor's command behavior and replaces the current receive handler with the specified handler.
(Inherited from ActorBase.) | |
BecomeStacked |
Changes the actor's behavior and replaces the current receive handler with the specified handler.
The current handler is stored on a stack, and you can revert to it by calling UnbecomeStacked (Inherited from ActorBase.)Remarks Please note, that in order to not leak memory, make sure every call to BecomeStacked(Receive)
is matched with a call to UnbecomeStacked. | |
Cancel | 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. | |
CreateT | ||
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
GetHashCode | Serves as the default hash function. (Inherited from Object.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
PostRestart |
User overridable callback: By default it calls `PreStart()`.
Is called right AFTER restart on the newly created Actor to allow reinitialization after an Actor crash.
(Inherited from ActorBase.) | |
PostStop |
User overridable callback.
Is called asynchronously after 'actor.stop()' is invoked.
Empty default implementation.
(Inherited from ActorBase.) | |
PreRestart |
User overridable callback: '''By default it disposes of all children and then calls `postStop()`.'''
Is called on a crashed Actor right BEFORE it is restarted to allow clean
up of resources before Actor is terminated.
(Inherited from ActorBase.) | |
PreStart |
User overridable callback.
Is called when an Actor is started.
Actors are automatically started asynchronously when created.
Empty default implementation.
(Inherited from ActorBase.) | |
Receive |
Processor for user defined messages.
(Inherited from ActorBase.) | |
Request |
Request a number of elements from upstream.
| |
SetReceiveTimeout | Defines the inactivity timeout after which the sending of a ReceiveTimeout message is triggered. When specified, the receive function should be able to handle a ReceiveTimeout message. Please note that the receive timeout might fire and enqueue the ReceiveTimeout message right after another message was enqueued; hence it is not guaranteed that upon reception of the receive timeout there must have been an idle period beforehand as configured via this method. Once set, the receive timeout stays in effect (i.e. continues firing repeatedly after inactivity periods). Pass in null to switch off this feature. | |
SupervisorStrategy |
TBD
(Inherited from ActorBase.) | |
ToString | Returns a string that represents the current object. (Inherited from Object.) | |
UnbecomeStacked |
Reverts the Actor behavior to the previous one on the behavior stack.
(Inherited from ActorBase.) | |
Unhandled |
Is called when a message isn't handled by the current behavior of the actor
by default it fails with either a DeathPactException (in
case of an unhandled Terminated message) or publishes an UnhandledMessage
to the actor's system's EventStream (Inherited from ActorBase.) |
Name | Description | |
---|---|---|
AsInstanceOfT |
TBD
(Defined by Extensions.) | |
Match | Overloaded.
Matches the specified target.
(Defined by PatternMatch.) | |
MatchT | Overloaded.
Matches the specified target and return a result of target processing.
(Defined by PatternMatch.) |