Programming Model
Distributed Async Await, like async await, builds on two abstractions, functions and promises. Functions are a universal abstraction for computation, promises are a universal abstraction for coordination.
Async Await
Sequential Programming
- Combines invocation and synchronization.
- Only one function execution enabled at one time.
In a traditional programming model, when a function (the caller) invokes another function (the callee), the callee begins and the caller suspends until the callee returns. Upon return, the caller resume execution with the return value of the callee. Executions proceed sequentially, that is, at any point in time exactly one execution may take a step.
Concurrent Programming
- Seperates invocation and synchronization.
- More than one function execution enabled at one time.
In async await, when the caller invokes the callee, the callee begins and the caller continues execution with a promise representing the callee. When the caller requires the return value of the callee, the caller awaits the promise suspending execution until the callee returns, at which point the caller resumes with the return value of the callee. Executions proceed concurrently, that is, at any point in time more than one execution may take a step.
The role of promises
Promises are a universal abstraction for coordination. They allow callers and callees to execute concurrently while still enabling the caller to coordinate by awaiting the completion and receiving the return value of the callee.
Distributed Async Await
Distributed Async Await extends async await to a concurrent and distributed programming model: Like async await, Distributed Async Await is based on functions and promises but adds Distributed Coordination and Distributed Recovery
Distributed Coordination
Distributed Async Await allows callers to invoke and await callees across processes. Promises are no longer local objects. Promises coordinate across the network, enabling the familiar semantics of Async Await to span across systems.
Distributed Recovery
Distributed Async Await defines recovery semantics in case of a process interruption.