Added a more Java-suitable, and less noisy become method
This commit is contained in:
parent
b6c782e6f9
commit
dfe4d77083
1 changed files with 9 additions and 1 deletions
|
|
@ -448,13 +448,21 @@ trait Actor extends Logging {
|
|||
def isDefinedAt(message: Any): Boolean = processingBehavior.isDefinedAt(message)
|
||||
|
||||
/** One of the fundamental methods of the ActorsModel
|
||||
* Actor assumes a new behavior
|
||||
* Actor assumes a new behavior,
|
||||
* None reverts the current behavior to the original behavior
|
||||
*/
|
||||
def become(behavior: Option[Receive]) {
|
||||
self.hotswap = behavior
|
||||
self.checkReceiveTimeout // FIXME : how to reschedule receivetimeout on hotswap?
|
||||
}
|
||||
|
||||
/** Akka Java API
|
||||
* One of the fundamental methods of the ActorsModel
|
||||
* Actor assumes a new behavior,
|
||||
* null reverts the current behavior to the original behavior
|
||||
*/
|
||||
def become(behavior: Receive): Unit = become(Option(behavior))
|
||||
|
||||
// =========================================
|
||||
// ==== INTERNAL IMPLEMENTATION DETAILS ====
|
||||
// =========================================
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue