Skip to content
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

Make the process implementation compatible with the async syntax #2

Open
R0DR160HM opened this issue Sep 20, 2024 · 0 comments
Open
Assignees
Labels
bug Something isn't working

Comments

@R0DR160HM
Copy link
Owner

Using the async syntax when starting a process (and as consequence, when creating a new task too) is currently unsuported.

const pid = process.start<number, number>(async foo => foo * 2);
process.call(pid.subject!, 10, Infinity);

throws ERROR ReferenceError: __async is not defined.

For now, a recommended workaround is

const pid = process.start(foo => {
    return new Promise(resolve => {
        resolve(foo * 2);
    });
});
process.call(pid.subject!, 10 Infinity);
@R0DR160HM R0DR160HM added the bug Something isn't working label Sep 20, 2024
@R0DR160HM R0DR160HM self-assigned this Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant