Changes the Actor's behavior to become the new
Receive handler.
This method acts upon the behavior stack as follows:
if discardOld==true it will replace the current behavior (i.e. the top element)
if discardOld==false it will keep the current behavior and push the given one atop
The default of replacing the current behavior on the stack has been chosen to avoid memory
leaks in case client code is written without consulting this documentation first (i.e.
always pushing new behaviors and never issuing an
Unbecome)
Namespace: Akka.ActorAssembly: Akka (in Akka.dll) Version: 0.8.0.0 (0.8.0.0)
Syntaxprotected void Become(
Receive receive,
bool discardOld = true
)
Protected Sub Become (
receive As Receive,
Optional discardOld As Boolean = true
)
protected:
void Become(
Receive^ receive,
bool discardOld = true
)
member Become :
receive : Receive *
?discardOld : bool
(* Defaults:
let _discardOld = defaultArg discardOld true
*)
-> unit
Parameters
- receive
- Type: Akka.ActorReceive
The receive delegate. - discardOld (Optional)
- Type: SystemBoolean
If true it will replace the current behavior;
otherwise it will keep the current behavior and it can be reverted using Unbecome
See Also