WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit 85c9568

Browse files
author
Guy Bedford
committed
0.11.1
1 parent 6c6f681 commit 85c9568

File tree

4 files changed

+57
-53
lines changed

4 files changed

+57
-53
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@bytecodealliance/jco",
3-
"version": "0.11.0",
3+
"version": "0.11.1",
44
"description": "JavaScript tooling for working with WebAssembly Components",
55
"author": "Guy Bedford",
66
"bin": {
@@ -18,7 +18,7 @@
1818
},
1919
"type": "module",
2020
"dependencies": {
21-
"@bytecodealliance/preview2-shim": "0.0.13",
21+
"@bytecodealliance/preview2-shim": "0.0.14",
2222
"binaryen": "^111.0.0",
2323
"chalk-template": "^0.4.0",
2424
"commander": "^9.4.1",

packages/preview2-shim/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@bytecodealliance/preview2-shim",
3-
"version": "0.0.13",
3+
"version": "0.0.14",
44
"description": "WASI Preview2 shim for JS environments",
55
"author": "Guy Bedford, Eduardo Rodrigues<[email protected]>",
66
"type": "module",
Lines changed: 27 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,39 @@
11
export namespace WasiPollPoll {
2-
export { Pollable };
2+
/**
3+
* Dispose of the specified `pollable`, after which it may no longer
4+
* be used.
5+
*/
6+
export function dropPollable(this_: Pollable): void;
37
/**
48
* Poll for completion on a set of pollables.
59
*
6-
* This function takes a list of pollables, which identify I/O sources of
7-
* interest, and waits until one or more of the events is ready for I/O.
8-
*
9-
* The result `list<bool>` is the same length as the argument
10-
* `list<pollable>`, and indicates the readiness of each corresponding
11-
* element in that list, with true indicating ready. A single call can
12-
* return multiple true elements.
13-
*
14-
* A timeout can be implemented by adding a pollable from the
15-
* wasi-clocks API to the list.
16-
*
17-
* This function does not return a `result`; polling in itself does not
18-
* do any I/O so it doesn't fail. If any of the I/O sources identified by
19-
* the pollables has an error, it is indicated by marking the source as
20-
* ready in the `list<bool>`.
21-
*
2210
* The "oneoff" in the name refers to the fact that this function must do a
2311
* linear scan through the entire list of subscriptions, which may be
2412
* inefficient if the number is large and the same subscriptions are used
2513
* many times. In the future, this is expected to be obsoleted by the
2614
* component model async proposal, which will include a scalable waiting
2715
* facility.
16+
*
17+
* The result list<bool> is the same length as the argument
18+
* list<pollable>, and indicates the readiness of each corresponding
19+
* element in that / list, with true indicating ready.
2820
*/
29-
export function pollOneoff(in_: Pollable[]): boolean[];
30-
}
31-
32-
export class Pollable {
33-
constructor(init: Uint8Array | ArrayBuffer)
34-
write(bytes: Uint8Array | ArrayBuffer): void;
35-
read(n: number): Uint8Array;
36-
static merge(lhs: Pollable, rhs: Pollable): Pollable;
21+
export function pollOneoff(in_: Uint32Array): boolean[];
3722
}
23+
/**
24+
* A "pollable" handle.
25+
*
26+
* This is conceptually represents a `stream<_, _>`, or in other words,
27+
* a stream that one can wait on, repeatedly, but which does not itself
28+
* produce any data. It's temporary scaffolding until component-model's
29+
* async features are ready.
30+
*
31+
* And at present, it is a `u32` instead of being an actual handle, until
32+
* the wit-bindgen implementation of handles and resources is ready.
33+
*
34+
* `pollable` lifetimes are not automatically managed. Users must ensure
35+
* that they do not outlive the resource they reference.
36+
*
37+
* This [represents a resource](https://github.com/WebAssembly/WASI/blob/main/docs/WitInWasi.md#Resources).
38+
*/
39+
export type Pollable = number;
Lines changed: 27 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,39 @@
11
export namespace WasiPollPoll {
2-
export { Pollable };
2+
/**
3+
* Dispose of the specified `pollable`, after which it may no longer
4+
* be used.
5+
*/
6+
export function dropPollable(this_: Pollable): void;
37
/**
48
* Poll for completion on a set of pollables.
59
*
6-
* This function takes a list of pollables, which identify I/O sources of
7-
* interest, and waits until one or more of the events is ready for I/O.
8-
*
9-
* The result `list<bool>` is the same length as the argument
10-
* `list<pollable>`, and indicates the readiness of each corresponding
11-
* element in that list, with true indicating ready. A single call can
12-
* return multiple true elements.
13-
*
14-
* A timeout can be implemented by adding a pollable from the
15-
* wasi-clocks API to the list.
16-
*
17-
* This function does not return a `result`; polling in itself does not
18-
* do any I/O so it doesn't fail. If any of the I/O sources identified by
19-
* the pollables has an error, it is indicated by marking the source as
20-
* ready in the `list<bool>`.
21-
*
2210
* The "oneoff" in the name refers to the fact that this function must do a
2311
* linear scan through the entire list of subscriptions, which may be
2412
* inefficient if the number is large and the same subscriptions are used
2513
* many times. In the future, this is expected to be obsoleted by the
2614
* component model async proposal, which will include a scalable waiting
2715
* facility.
16+
*
17+
* The result list<bool> is the same length as the argument
18+
* list<pollable>, and indicates the readiness of each corresponding
19+
* element in that / list, with true indicating ready.
2820
*/
29-
export function pollOneoff(in_: Pollable[]): boolean[];
30-
}
31-
32-
export class Pollable {
33-
constructor(init: Uint8Array)
34-
write(bytes: Uint8Array): void;
35-
read(n: number): Uint8Array | ArrayBuffer;
36-
static merge(lhs: Pollable, rhs: Pollable): Pollable;
21+
export function pollOneoff(in_: Uint32Array): boolean[];
3722
}
23+
/**
24+
* A "pollable" handle.
25+
*
26+
* This is conceptually represents a `stream<_, _>`, or in other words,
27+
* a stream that one can wait on, repeatedly, but which does not itself
28+
* produce any data. It's temporary scaffolding until component-model's
29+
* async features are ready.
30+
*
31+
* And at present, it is a `u32` instead of being an actual handle, until
32+
* the wit-bindgen implementation of handles and resources is ready.
33+
*
34+
* `pollable` lifetimes are not automatically managed. Users must ensure
35+
* that they do not outlive the resource they reference.
36+
*
37+
* This [represents a resource](https://github.com/WebAssembly/WASI/blob/main/docs/WitInWasi.md#Resources).
38+
*/
39+
export type Pollable = number;

0 commit comments

Comments
 (0)