remove ActorRef#tell(Any), see #3293
also remove FakeActorRef from SerCompSpec
This commit is contained in:
parent
b3db19ee05
commit
ddf2117ed7
9 changed files with 17 additions and 69 deletions
|
|
@ -291,7 +291,7 @@ filling in will they be transferred into the real mailbox. Thus,
|
|||
|
||||
final Props props = ...
|
||||
// this actor uses MyCustomMailbox, which is assumed to be a singleton
|
||||
system.actorOf(props.withDispatcher("myCustomMailbox").tell("bang");
|
||||
system.actorOf(props.withDispatcher("myCustomMailbox").tell("bang", sender);
|
||||
assert(MyCustomMailbox.getInstance().getLastEnqueued().equals("bang"));
|
||||
|
||||
will probably fail; you will have to allow for some time to pass and retry the
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ by the ``ExecutionContexts`` class to wrap ``Executors`` and ``ExecutorServices`
|
|||
Use with Actors
|
||||
---------------
|
||||
|
||||
There are generally two ways of getting a reply from an ``UntypedActor``: the first is by a sent message (``actorRef.tell(msg)``),
|
||||
There are generally two ways of getting a reply from an ``UntypedActor``: the first is by a sent message (``actorRef.tell(msg, sender)``),
|
||||
which only works if the original sender was an ``UntypedActor``) and the second is through a ``Future``.
|
||||
|
||||
Using the ``ActorRef``\'s ``ask`` method to send a message will return a ``Future``.
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ Sending a message to a router is easy.
|
|||
|
||||
.. code-block:: java
|
||||
|
||||
router.tell(new MyMsg());
|
||||
router.tell(new MyMsg(), sender);
|
||||
|
||||
A router actor forwards messages to its routees according to its routing policy.
|
||||
|
||||
|
|
|
|||
|
|
@ -467,7 +467,7 @@ an ``onComplete``-handler on the future to effect the submission of the
|
|||
aggregated :class:`Result` to another actor.
|
||||
|
||||
Using ``ask`` will send a message to the receiving Actor as with ``tell``, and
|
||||
the receiving actor must reply with ``getSender().tell(reply)`` in order to
|
||||
the receiving actor must reply with ``getSender().tell(reply, getSelf())`` in order to
|
||||
complete the returned :class:`Future` with a value. The ``ask`` operation
|
||||
involves creating an internal actor for handling this reply, which needs to
|
||||
have a timeout after which it is destroyed in order not to leak resources; see
|
||||
|
|
@ -533,7 +533,7 @@ Reply to messages
|
|||
|
||||
If you want to have a handle for replying to a message, you can use
|
||||
``getSender()``, which gives you an ActorRef. You can reply by sending to
|
||||
that ActorRef with ``getSender().tell(replyMsg)``. You can also store the ActorRef
|
||||
that ActorRef with ``getSender().tell(replyMsg, getSelf())``. You can also store the ActorRef
|
||||
for replying later, or passing on to other actors. If there is no sender (a
|
||||
message was sent without an actor or future context) then the sender
|
||||
defaults to a 'dead-letter' actor ref.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue