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

Api::resume() and throw() make it difficult to integrate with sync code. #125

Closed
jmalloc opened this issue Jul 20, 2016 · 3 comments
Closed
Milestone

Comments

@jmalloc
Copy link
Member

jmalloc commented Jul 20, 2016

The intent of these methods was to provide a way to resume strands as part of the kernel API, so that it may be versioned independently of the underlying strand implementation (#124). However, using these operations (exclusively) means that you can't resume strands from outside a coroutine.

Long story short, there needs to be a way to resume strands from "regular PHP code" that is part of the public API. Strand already implements Listener, so perhaps this is as simple as packaging and versioning Listener along with Api.

FYI @koden-km

@jmalloc jmalloc added this to the 1.0.0 milestone Jul 20, 2016
@jmalloc jmalloc changed the title Using Api::resume() and throw() makes it difficult to integrate with sync code. Api::resume() and throw() make it difficult to integrate with sync code. Jul 20, 2016
@jmalloc
Copy link
Member Author

jmalloc commented Jul 20, 2016

Specification wise this would also mean the first callback to Recoil::suspend() should accept Listener rather than Strand specifically.

We could take this further and make Api::send() and throw() take listeners too, though I'm not sure if this is actually a good idea - if Listener is to be considered part of the kernel API then there's probably no need for the Api methods at all - perhaps then they could go back to their original behaviour of resuming on the next-tick, rather than immediately.

@jmalloc
Copy link
Member Author

jmalloc commented Jul 21, 2016

So after discussion today, the question is, do we:

(a) remove Api::resume() and throw() altogether
(b) revert them to their original 'next tick' behaviour

@jmalloc
Copy link
Member Author

jmalloc commented Jul 26, 2016

Let's remove them. They offer no immediate value if Listener is considered part of the kernel API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant