Merge pull request #22739 from ktoso/wip-typed-hide-bang
+typ #22663 move symbolic ! into implicit class of ActorRef
This commit is contained in:
commit
df3353a066
2 changed files with 9 additions and 6 deletions
|
|
@ -25,12 +25,6 @@ abstract class ActorRef[-T](_path: a.ActorPath) extends java.lang.Comparable[Act
|
|||
*/
|
||||
def tell(msg: T): Unit
|
||||
|
||||
/**
|
||||
* Send a message to the Actor referenced by this ActorRef using *at-most-once*
|
||||
* messaging semantics.
|
||||
*/
|
||||
def !(msg: T): Unit = tell(msg)
|
||||
|
||||
/**
|
||||
* Narrow the type of this `ActorRef, which is always a safe operation.
|
||||
*/
|
||||
|
|
@ -74,6 +68,15 @@ abstract class ActorRef[-T](_path: a.ActorPath) extends java.lang.Comparable[Act
|
|||
}
|
||||
|
||||
object ActorRef {
|
||||
|
||||
implicit final class ActorRefScalaTell[-T](val ref: ActorRef[T]) extends AnyVal {
|
||||
/**
|
||||
* Send a message to the Actor referenced by this ActorRef using *at-most-once*
|
||||
* messaging semantics.
|
||||
*/
|
||||
def !(msg: T): Unit = ref.tell(msg)
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an ActorRef from a Future, buffering up to the given number of
|
||||
* messages in while the Future is not fulfilled.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue