resonate-sdk-ts icon indicating copy to clipboard operation
resonate-sdk-ts copied to clipboard

Tasks

Open avillega opened this issue 6 months ago • 5 comments

Both the SDK and the Resonate server are converging in what we now call tasks. There are two types of tasks that represent the events of the global event loop, Resume and Invoke.

Resume event signals a Resonate node that a promise the node was awaiting on has been completed and the node can resume work where it left off.

Invoke event signal a Resonate node to invoke a function in its local execution context and report back its results.

Considerations

  • It is necessary to have a generic mechanism to accept task in the SDK, task could come as an http request, messages in distributed queue system like SQS or be polled by the SDK itself from the server.
  • We should allow users of the resonate SDK to implement their own tasks sources in a way that is compatible with the rest of the Resonate architecture like the server communication.
  • We need a local tasks source to be able to use the Resonate SDK without a server running.

avillega avatar Aug 15 '24 21:08 avillega