recoilphp / recoil

Asynchronous coroutines for PHP 7.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support "async-interop" interfaces.

jmalloc opened this issue · comments

Blocked: there are no stable releases of the async-interop packages.

The async-interop organisation provides some interfaces that seek to improve interoperability of async libraries.

Recoil should provide support for each of them:

  • Interop\Async\Loop\Driver - As of async-interop/event-loop#87, Driver is an abstract class, so Kernel can not simply be a driver with additional features. Instead we can:
    • Provide a Kernel -> Driver adaptor
    • Provide a Driver-based kernel, much like ReactKernel (see #148)
    • The native kernel could implement this interface directly. I think this is preferable than having the Kernel interfae extend Driver, as other implementations may have a more direct way of implementing Driver.
  • Interop\Async\Loop\DriverFactory
    • I'm not sure what's best here, perhaps simply having separate implementations for creating a ReactKernel vs a NativeKernel.
  • Interop\Async\Awaitable\Awaitable
    • Should be yieldable (ie, supported by Api::dispatch())
    • Could possibly be extended by Recoil's own Awaitable interface, with some renaming.
    • Could possibly be extended by Strand
    • Handling errors requires use of the "global loop accessor" to push errors to the current loop implementation, which might conflict or bypass recoil's own event handler? Need to look into it further.
  • Interop\Async\Promise\Promise
    • Should be yieldable (ie, supported by Api::dispatch())
    • Retain support for then method detection, but favour this interface so that we can use done() when we know its available

The loop package has now received a 0.1.0 tag.

The promise repo is gone now too.

The loop project has been put on hold and probably wont come back - https://github.com/async-interop/event-loop#current-status