Open hassan-shahbazi opened 3 years ago
I think it's better to fit with the standard Go stream/pipe API if such thing exists, rather than developping more features inside the Wasmer C API. We already have wasi_env_read_stdout
(and …_stderr
) that allows to read data from stdout
and stderr
with a buffer already. It's pretty flexible.
Motivation
The support of WASI has been added in the latest version of wasmer-go. It is now possible to capture
Stdout
andStderr
outputs using CaptureStdout and CaptureStderr APIs respectively. However, there is not yet any API for setting the custom pipes for them and thus, it is not yet possible to take the full advantage from WASI APIs.Proposed solution
I am not an expert, but I can think of the following functions. The important point, however, is that they should accept both normal files and pipes. Currently, wasmtime has the same set of APIs, but it is unable to accept pipes and thus, it is not practical in many cases.