-
Notifications
You must be signed in to change notification settings - Fork 256
Closed
Labels
asyncRelated to async/streams in the component model.Related to async/streams in the component model.gen-rustRelated to bindings for Rust-compiled-to-WebAssemblyRelated to bindings for Rust-compiled-to-WebAssembly
Description
Discussed some time ago, forgotten, and then reminded today, the expectation is that at the component model level dropping a writable-end future will be a trap if nothing was actually written. Modeling this in Rust without actually surfacing traps will be done with a few changes:
- When a
FutureWriter<T>is constructed an additional parameterdefault: fn() -> Twill be required. This will be stored within theFutureWriter<T>return value. - When a
FutureWriter<T>is dropped without recording a successful write then a task will be spawned which actually performs the write (e.g. calls thedefaultand then performs the write for you).
This needs to be implemented in the Rust bindings.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
asyncRelated to async/streams in the component model.Related to async/streams in the component model.gen-rustRelated to bindings for Rust-compiled-to-WebAssemblyRelated to bindings for Rust-compiled-to-WebAssembly