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

Add spawn function #420

Closed
wants to merge 3 commits into from
Closed

Add spawn function #420

wants to merge 3 commits into from

Conversation

danog
Copy link
Contributor

@danog danog commented Jul 24, 2023

No description provided.

@kelunik
Copy link
Member

kelunik commented Jul 25, 2023

As previously discussed, I don't see any benefit over using async().

@danog
Copy link
Contributor Author

danog commented Jul 25, 2023

One very clear benefit is to avoid the overhead of creating a future, without having to use EventLoop::queue.

@trowski
Copy link
Member

trowski commented Aug 7, 2023

The main purpose I see to this is providing a tool to create a fiber without the future within the Amp eco-system. Otherwise obviously it is exactly the same as using EventLoop::queue(). I can see benefits to this, as it might be easier for newcomers to discover Amp\spawn() over needing to read the event loop docs.

For a full compliment of Amp namespaced functions, we'd probably also need Amp\setEventLoopErrorHandler() and Amp\runEventLoop() (or similar). Maybe I've forgotten something? I think without these as well, there's not much benefit because users will still need to learn about the event loop API.

@kelunik kelunik closed this Nov 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants