Skip to content

Commit 043eafa

Browse files
authored
Remove the documentation about pseudo-handles. (#579)
The component model now has support for resources, and WASI is now updated to use them, so we can remove the documentation section about working around the lack of resources. Also, polling has moved from wasi-poll to wasi-io.
1 parent 256b651 commit 043eafa

File tree

1 file changed

+1
-47
lines changed

1 file changed

+1
-47
lines changed

docs/WitInWasi.md

Lines changed: 1 addition & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -23,51 +23,6 @@ so at this time some features or planned features in the component model are
2323
not ready for use in WASI APIs. Here's a list of those features and what to use
2424
for now in their place.
2525

26-
### Resources
27-
28-
Resources are expected to be available in time for Preview2, but at this time
29-
still in development.
30-
31-
As a temporary workaround, WASI proposals are using `u32` types, which
32-
represent indices into an implied global table of handles. Since it is
33-
implied and global, this table doesn't provide any isolation between
34-
components; it intended to be a temporary workaround to support prototyping.
35-
36-
In place of a resource like this:
37-
38-
```wit
39-
/// An example resource.
40-
///
41-
/// A description of the example resource.
42-
resource resource-name {
43-
/// An example function.
44-
///
45-
/// A description of the example function.
46-
function-name: func()
47-
}
48-
```
49-
50-
Define a `u32` type alias, an explicit `drop` function, and change all
51-
functions inside the resource to have an explicit `this` argument, like this:
52-
53-
```wit
54-
/// An example resource.
55-
///
56-
/// A description of the example resource.
57-
///
58-
/// This [represents a resource](https://github.com/WebAssembly/WASI/blob/main/docs/WitInWasi.md#Resources).
59-
type resource-name = 32
60-
61-
/// An example function.
62-
///
63-
/// A description of the example function.
64-
function-name: func(this: resource-name)
65-
66-
/// Dispose of the specified `resource-name`, after which it may no longer
67-
/// be used.
68-
drop-resource-name: func(this: resource-name)
69-
```
70-
7126
### Streams
7227

7328
Streams are expected to be available in the Preview 3 timeframe, as part of the
@@ -85,15 +40,14 @@ with a function returning `option<T>` or `result<option<T>, E>` for returning
8540
the elements with `none` indicating the end of the stream.
8641

8742
This resource-based workaround can be used for asynchronous I/O by using
88-
[wasi-poll] to poll for multiple streams, however it doesn't support
43+
[wasi-io] to poll for multiple streams, however it doesn't support
8944
composing asynchronous work across multiple components, and it has some scaling
9045
limitations. These limitations will be fixed when built in `stream` types are
9146
available.
9247

9348
[Component Model async proposal]: https://docs.google.com/presentation/d/1MNVOZ8hdofO3tI0szg_i-Yoy0N2QPU2C--LzVuoGSlE/edit#slide=id.g1270ef7d5b6_0_662
9449
[use]: #Dependencies
9550
[wasi-io]: https://github.com/WebAssembly/wasi-io
96-
[wasi-poll]: https://github.com/WebAssembly/wasi-poll
9751
[resource]: #Resources
9852

9953
### Value Imports

0 commit comments

Comments
 (0)