Skip to content

Commit

Permalink
fixup!: docs: Immediate, Prompt and Delayed promises
Browse files Browse the repository at this point in the history
Co-authored-by: Mathieu Hofman <[email protected]>
  • Loading branch information
turadg and mhofman authored Sep 26, 2024
1 parent 228bace commit 593292d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/SwingSet/docs/async.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ An **Immediate** promise is one that settles within the same Crank as its creati

A **Prompt** promise settles without requiring further input from outside SwingSet. All Immediate promises are also Prompt, but not all Prompt promises are Immediate.

The SwingSet kernel processes run queue items until there is nothing left to run. Most hosts, like cosmic-swingset, do not inject new items before the queue is empty. In those cases the SwingSet kernel executes similarly to how a vat executes a crank: an external I/O triggers some execution, and the resulting queue items are drained before returning to the host for the next I/O.
The SwingSet kernel processes its run queue items until there is nothing left to run. Most hosts, like cosmic-swingset, do not inject new items on the SwingSet run queue until it's empty, and instead maintain their own queue of input events. In those cases the SwingSet kernel executes similarly to how a vat executes a crank: an external I/O event triggers some execution, and the resulting SwingSet run queue items are drained before returning to the host for the next I/O.

While any of these queue items can technically cause a vat to upgrade, most systems running on SwingSet will trigger a vat upgrade based on some I/O input. As such, Prompt promises are unaffected by vat upgrades, unless the vat getting upgraded somehow got involved in processing the I/O that triggered its own upgrade.

Expand All @@ -44,7 +44,7 @@ The following are examples of I/O that can prevent a promise from being Prompt (

### Factors That Do Not Affect Promptness

- **Upgrade**: cosmic-swingset ensures quiescence between I/O and vat upgrades are triggered are triggered only when processing a new item from the chain's action queue (such as network input).
- **Upgrade**: cosmic-swingset ensures quiescence between I/O and vat upgrades are triggered only when processing a new item from the chain's action queue (such as network input).
- **Bridge Calls**: Bridge calls are Prompt. While the caller may subsequently wait for an acknowledgment input (which is not Prompt), the bridge call itself does not affect promptness.

## Delayed Promises
Expand Down

0 comments on commit 593292d

Please sign in to comment.