You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In #378, it'd be nice of we can abort the loading of a package if the arguments to useWasmerPackage() change.
To do this, we need to update things in two places.
First, we need to update the fetch() function in wasmer_wasix::http::web_http_client to use a RAII guard which triggers an abort controller on Drop and pass that abort controller's AbortSignal through to the request (the RequestInit type has a signal setter). That'll make sure any in-progress HTTP requests get cancelled automatically when the future is dropped.
We also need to update wasmer_js::Wasmer's from_registry() and from_file() constructors to accept an optional AbortSignal parameter and use futures::select!() to wait on either the package loading or an abort, whichever resolves first. If the futures::select!() detects an abort, it should automatically drop the future from BinaryPackage::from_registry() or BinaryPackage::from_webc(), which will automatically cancel any child futures until eventually the HTTP request is cancelled.
In #378, it'd be nice of we can abort the loading of a package if the arguments to
useWasmerPackage()
change.To do this, we need to update things in two places.
First, we need to update the
fetch()
function inwasmer_wasix::http::web_http_client
to use a RAII guard which triggers an abort controller onDrop
and pass that abort controller'sAbortSignal
through to the request (theRequestInit
type has asignal
setter). That'll make sure any in-progress HTTP requests get cancelled automatically when the future is dropped.We also need to update
wasmer_js::Wasmer
'sfrom_registry()
andfrom_file()
constructors to accept an optionalAbortSignal
parameter and usefutures::select!()
to wait on either the package loading or an abort, whichever resolves first. If thefutures::select!()
detects an abort, it should automatically drop the future fromBinaryPackage::from_registry()
orBinaryPackage::from_webc()
, which will automatically cancel any child futures until eventually the HTTP request is cancelled.SDK-61
The text was updated successfully, but these errors were encountered: