-
Notifications
You must be signed in to change notification settings - Fork 229
Open
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
Currently, async_support::spawn
accepts an impl Future<Output = ()>
, but it should probably take something like impl Future<Output = anyhow::Result<()>>
instead, since the most common cases for spawned Future
s involve fallible I/O, and forcing the application to .unwrap()
(and thus trap) on any error is not a great default experience.
In the case where such a Future
returns an error, we can convert it to a debug string, pass that string to ErrorContext::new
, and then close any open stream
s and/or future
s (read or write ends) with that error-context
.
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