recoilphp / recoil

Asynchronous coroutines for PHP 7.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

A way to yield raw value

nick4fake opened this issue · comments

Hi,

yielding of raw values could be a great addition to this library. This could allow us to use coroutines as generators with Promise support. Probably an api call that results in just value return could be a solution?

Can you provide an example of what you mean?

I think you're talking about asynchronous generators. Assuming I'm on the right track there, that's a bit of a tricky thing to solve, simply because Recoil's kernel is responsible for iterating the generator so that it can capture the values and react to them as API calls, etc.