Closed stefansavev-o closed 7 years ago
Are you asking for that functionality in exorelay or exoservice? You point to exorelay in js but then want this implement in exoservice.
Also for the exoservice, there currently isn't an exposed send function. There is only send function passed to the message handlers. Is that where you would want this function?
In ExoService. I can add sample code with my solution if you are interested.
Yeah that would be helpful
Also one of my questions wasn't answered
Also for the exoservice, there currently isn't an exposed send function. There is only send function passed to the message handlers. Is that where you would want this function?
That will work for my use cases. but the flow is like this
onHandler(msg){ result := await call exosphere with another message (similar to NodeJs and Python await, although go does not have that) do something with result return from the handler }
Okay cool. That should be easy enough to add
I encountered a dead lock when I implemented this and had to put the handler on a go routine. So deadlocks is something to watch for.
@stefansavev-o a change @kevgo wants to make is removing responseTo
and adding activityId
where a message basically starts a thread which any service can reply to. We can introduce a WaitForMessage
method that allows you to pass in an activityId
and a message name to wait for a specific reply
ok, so it would be something like
activityId := Send(...)
response: = WaitFor(activityId, msgName)
Ok, this will be useful. If you generalize WaitFor to multiple activities/messages also very useful.
blocked by #166
The livescript send functionality supports a callback like this:
Introduce a similar functionality. I propose the following signature
Proposed Usage: