-
Notifications
You must be signed in to change notification settings - Fork 280
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Run script of my vorpal commands does not work on async functions #346
Comments
Maybe before creating the Promise, there should be a test is it is async function. function isAsync(func) {
return func.constructor.name === "AsyncFunction";
} |
Late to the party here, but I solved this problem using sync-rpc to put my asynchronous operations into a worker thread. It's like magic! The main thread sees synchronous operation while the worker thread does the async stuff. Sounds complicated (for someone like me who never used workers before) but just follow the example in sync-rpc and it's not very difficult. |
I tried to write a script runner, but it does not wait for async functions:
Tried that too, but it exits instantly:
Any ideas?
The text was updated successfully, but these errors were encountered: