ReceiveActorReceive Method (Type, ActionObject, PredicateObject) |
Registers a handler for incoming messages of the specified
[!:messageType].
If
shouldHandle!=
null then it must return true before a message is passed to
handler.
Remarks
RemarksNote that handlers registered prior to this may have handled the message already.
In that case, this handler will not be invoked.
Namespace: Akka.ActorAssembly: Akka (in Akka.dll) Version: 0.8.0.0 (0.8.0.0)
Syntaxprotected void Receive(
Type messageType,
Action<Object> handler,
Predicate<Object> shouldHandle = null
)
Protected Sub Receive (
messageType As Type,
handler As Action(Of Object),
Optional shouldHandle As Predicate(Of Object) = Nothing
)
protected:
void Receive(
Type^ messageType,
Action<Object^>^ handler,
Predicate<Object^>^ shouldHandle = nullptr
)
member Receive :
messageType : Type *
handler : Action<Object> *
?shouldHandle : Predicate<Object>
(* Defaults:
let _shouldHandle = defaultArg shouldHandle null
*)
-> unit
Parameters
- messageType
- Type: SystemType
The type of the message - handler
- Type: SystemActionObject
The message handler that is invoked for incoming messages of the specified [!:messageType] - shouldHandle (Optional)
- Type: SystemPredicateObject
When not null it is used to determine if the message matches.
See Also