Skip to content

Commit

Permalink
Describe 'non-blocking' in WIT.md
Browse files Browse the repository at this point in the history
  • Loading branch information
lukewagner committed Jan 22, 2025
1 parent d1db043 commit 3bdea27
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions design/mvp/WIT.md
Original file line number Diff line number Diff line change
Expand Up @@ -1309,6 +1309,16 @@ named-type-list ::= ϵ
named-type ::= id ':' ty
```

The optional `non-blocking` attribute on WIT function types indicates that the
callee *should not* block and thus the caller *should not* need to emit
asynchronous language bindings (e.g., in JS/Python/Rust, a `non-blocking`
function would emit a plain function instead of an `async` function). However,
`non-blocking` is just a hint and not enforced by the runtime and so it is
technically possible for the callee to block. In that case, though, it is the
*callee's* fault for any resultant loss of concurrency, not the caller's. Thus,
`non-blocking` is primarily intended to document expectations in a way that can
be taken advantage of by bindings generators.


## Item: `use`

Expand Down

0 comments on commit 3bdea27

Please sign in to comment.