Support "async-interop" interfaces.
jmalloc opened this issue · comments
James Harris commented
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, soKernel
can not simply be a driver with additional features. Instead we can:- Provide a
Kernel
->Driver
adaptor - Provide a
Driver
-based kernel, much likeReactKernel
(see #148) The native kernel could implement this interface directly. I think this is preferable than having the.Kernel
interfae extendDriver
, as other implementations may have a more direct way of implementingDriver
- Provide a
-
Interop\Async\Loop\DriverFactory
- I'm not sure what's best here, perhaps simply having separate implementations for creating a
ReactKernel
vs aNativeKernel
.
- I'm not sure what's best here, perhaps simply having separate implementations for creating a
-
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.
- Should be yieldable (ie, supported by
-
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 usedone()
when we know its available
- Should be yieldable (ie, supported by
James Harris commented
The loop package has now received a 0.1.0 tag.
James Harris commented
The promise repo is gone now too.
James Harris commented
The loop project has been put on hold and probably wont come back - https://github.com/async-interop/event-loop#current-status