Click or drag to resize
Akka.NETIActorContext Interface
TBD

Namespace:  Akka.Actor
Assembly:  Akka (in Akka.dll) Version: 1.2.3.129 (1.2.3.129)
Syntax
public interface IActorContext : IActorRefFactory, 
	ICanWatch

The IActorContext type exposes the following members.

Properties
  NameDescription
Public propertyDispatcher
The dispatcher this actor is running on
Public propertyParent
Gets the IActorRef of the parent of the current actor.
Public propertyProps
The Props used to originally create this IActorRef
Public propertyReceiveTimeout
Public propertySelf
Gets the IActorRef belonging to the current actor.
Public propertySender
Gets the IActorRef of the actor who sent the current message. If the message was not sent by an actor (i.e. some external non-actor code sent this actor a message) then this value will default to NoSender.
Public propertySystem
Gets a reference to the ActorSystem to which this actor belongs.
Remarks
This property is how you can get access to the IScheduler and other parts of Akka.NET from within an actor instance.
Top
Methods
  NameDescription
Public methodActorOf
Create new actor as child of this context with the given name, which must not start with "$". If the given name is already in use, and InvalidActorNameException is thrown. See Props for details on how to obtain a Props object.
(Inherited from IActorRefFactory.)
Public methodActorSelection(String)
Construct an ActorSelection from the given path, which is parsed for wildcards (these are replaced by regular expressions internally). No attempt is made to verify the existence of any part of the supplied path, it is recommended to send a message and gather the replies in order to resolve the matching set of actors.
(Inherited from IActorRefFactory.)
Public methodActorSelection(ActorPath)
Construct an ActorSelection from the given path, which is parsed for wildcards (these are replaced by regular expressions internally). No attempt is made to verify the existence of any part of the supplied path, it is recommended to send a message and gather the replies in order to resolve the matching set of actors.
(Inherited from IActorRefFactory.)
Public methodBecome
Changes the actor's behavior and replaces the current receive handler with the specified handler.
Public methodBecomeStacked
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
Remarks
Please note, that in order to not leak memory, make sure every call to BecomeStacked(Receive) is matched with a call to UnbecomeStacked.
Public methodChild
Retrieves a child actor with the specified name, if it exists. If the child with the given name cannot be found, then Nobody will be returned instead.
Public methodGetChildren
Gets all of the children that belong to this actor. If this actor has no children, an empty collection of IActorRef is returned instead.
Public methodSetReceiveTimeout

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.

Public methodStop
Issues a stop command to the provided IActorRef, which will cause that actor to terminate.
Public methodUnbecomeStacked
Changes the actor's behavior and replaces the current receive handler with the previous one on the behavior stack.
Remarks
In order to store an actor on the behavior stack, a call to BecomeStacked(Receive) must have been made prior to this call
Public methodUnwatch
Stops monitoring the subject for termination.
(Inherited from ICanWatch.)
Public methodWatch
Monitors the specified actor for termination. When the subject terminates the instance watching will receive a Terminated message.
Remarks
Note that if the Terminated message isn't handled by the actor, by default the actor will crash by throwing a DeathPactException. To change the default behavior, override Unhandled(Object).
(Inherited from ICanWatch.)
Top
Extension Methods
  NameDescription
Public Extension MethodActorOf(ActionIActorDsl, String)Overloaded.
TBD
(Defined by ActExtensions.)
Public Extension MethodActorOf(ActionIActorDsl, IActorContext, String)Overloaded.
TBD
(Defined by ActExtensions.)
Public Extension MethodActorOfTActor(String)Overloaded.
TBD
(Defined by ActorRefFactoryExtensions.)
Public Extension MethodActorSelection
Construct an ActorSelection from the given string representing a path relative to the given target. This operation has to create all the matching magic, so it is preferable to cache its result if the intention is to send messages frequently.
(Defined by ActorRefFactoryExtensions.)
Public Extension MethodCreateStash(Type)Overloaded.
TBD
(Defined by StashFactory.)
Public Extension MethodCreateStash(IActorStash)Overloaded.
TBD
(Defined by StashFactory.)
Public Extension MethodCreateStashTOverloaded.
TBD
(Defined by StashFactory.)
Public Extension MethodDI
Creates an adapter used to generate Props configuration objects using the DI extension using a given actor context.
(Defined by Extensions.)
Public Extension MethodGetLogger
Creates a new logging adapter using the specified context's event stream.
(Defined by Logging.)
Public Extension MethodLoadFailureDetector
Loads an instantiates a given FailureDetector implementation. The class to be loaded must have a constructor that accepts a Config and an EventStream parameter. Will throw ConfigurationException if the implementation cannot be loaded.
(Defined by FailureDetectorLoader.)
Public Extension MethodMaterializer

Creates a ActorMaterializer which will execute every step of a transformation pipeline within its own ActorBase. The required IActorRefFactory (which can be either an ActorSystem or an IActorContext) will be used to create one actor that in turn creates actors for the transformation steps.

The materializer's ActorMaterializerSettings will be obtained from the configuration of the context's underlying ActorSystem.

The namePrefix is used as the first part of the names of the actors running the processing steps. The default namePrefix is "flow". The actor names are built up of namePrefix-flowNumber-flowStepNumber-stepName.

(Defined by ActorMaterializerExtensions.)
Top
See Also