GemTalk / RemoteServiceReplication

MIT License
0 stars 4 forks source link

Synchronous message sends #117

Closed kurtkilpela closed 1 week ago

kurtkilpela commented 3 years ago

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.

(remoteSelf
  process: anObject
  from: aSource) wait
| promise |
promise := remoteSelf
  process: anObject
  from: aSource.
promise wait

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.

remoteSelf
  process: anObject
  from: aSource
kurtkilpela commented 1 week ago

I don't plan to implement this unless someone explicitly requests it.