Sending a message to remoteSelf will return a Promise object. You can then send #wait if you'd like to pause until a response is available. This could be made simpler or at least drop the need for parenthesis in some situations using a pattern like below.
remoteSelf _sync
process: anObject
from: aSource
Right now, you'd need to use a pattern like one of the following.
It may also be helpful to allow a service to specify whether message sends should be synchronous or asynchronous. Depending upon how the Service is configured, the following may return a result or a Promise.
Sending a message to
remoteSelf
will return a Promise object. You can then send#wait
if you'd like to pause until a response is available. This could be made simpler or at least drop the need for parenthesis in some situations using a pattern like below.Right now, you'd need to use a pattern like one of the following.
It may also be helpful to allow a service to specify whether message sends should be synchronous or asynchronous. Depending upon how the Service is configured, the following may return a result or a Promise.