-
Notifications
You must be signed in to change notification settings - Fork 22
Description
Some functions, such as password stretching functions and key pair creation functions, can take a long time to return.
This is an issue in contexts that don't expect calls to be blocking. JavaScript is an obvious example of this.
The usual way to workaround it is to make the API asynchronous (as in scrypt-async). A computation step is performed, then the function returns but signals that more steps are needed in order to complete.
We can do something very similar. Reserve an error code for this, and bindings would try again until the operation returns a different error code.
Is there a better way to address this? I remember discussions about having the equivalent of promises in WASI. Is it still something being considered, and that we could use instead?