-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added reactive design doc #60
Conversation
Signed-off-by: Jiaxiao Zhou <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
~a couple of suggestions, requests, and questions.
@@ -4,8 +4,8 @@ wasi-cloud is a set of consistent, modular and portable interfaces that provide | |||
1. **Portability**: wasi-cloud is vendor-neutral, and can run on various host environments (e.g., cloud, edge, bare-metal etc.) and deployment runtime (e.g., VM, containers, standalone etc.), using different programming languages (e.g., Rust, C etc.) | |||
2. **Security**: applications that link to wasi-cloud libc will run in a sandboxed environment. The host will put capability functions in a sandboxed environment that the code can run. | |||
3. **Modular**: | |||
|
|||
 | |||
w |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
~remove stray "w"
|
||
let events = exec::Events::get()?; | ||
events | ||
.listen(watch(rd, "my-key1")?))? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think spacing might have gotten incorrectly formatted here.
} | ||
``` | ||
|
||
The above example shows that the guest application can define a events resource and listen on streams of events that are observed by invoking `watch` functions on resource descriptors and keys to watch on. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: instead of "a events", say "an events"
I then gave up using `wit_bindgen_wasmtime::export!("exec.wit");` in the host. | ||
|
||
In [the second iteration](https://github.com/Mossaka/wasi-callback/pull/1/files#diff-42cb6807ad74b3e201c5a7ca98b911c5fa08380e942be6e4ac5807f8377f87fc), I copied the generated `[bindings.rs](http://bindings.rs)` to the src folder, and modified the generated APIs in this file to suit my needs. Specifically, I made the API to use reference counting to access host states, and thus I can have two mutable references to the same data structure. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question: again again again again, do we want to use first person here?
|
||
### Threading | ||
|
||
In the reactive design, I want events to expose an API to resources so that each resource can implement their own listen for change code, and send event back to a channel. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question: again again again again again, do we want to use first-person here?
09239e3
to
0921137
Compare
Signed-off-by: Jiaxiao Zhou [email protected]