async-interop / event-loop

An event loop interface for interoperability in PHP.
MIT License
169 stars 9 forks source link

Two working implementations #124

Open kelunik opened 7 years ago

kelunik commented 7 years ago

Following the FIG, I think it's good to have two working implementations passing all tests. I think we should have v0.4.0 and two working implementations, then tag v1.0.0.

bwoebi commented 7 years ago

AFAIK we have a working implementation by @martinschroeder: koolkode/async: https://github.com/koolkode/async And our own, amp/loop: https://github.com/amphp/loop

which each pass all tests by their currently supported loops.

kelunik commented 7 years ago

@bwoebi We need tests for strict types. koolkode/async uses strict types currently.

bwoebi commented 7 years ago

Yeah, that has been changed very recently, will add a test to event-loop-test repo

bwoebi commented 7 years ago

Test added \cc @martinschroeder

kelunik commented 7 years ago

@bwoebi There's a typo in your ping.

I just tagged v0.4.0, so implementations can depend on that. I guess we will have a tag for the tests soon.

https://github.com/async-interop/event-loop/releases/tag/v0.4.0

ghost commented 7 years ago

Thanks for letting me know. I removed strict types from the loop implementations and will have a look into version 0.4 of the loop spec today or maybe tomorrow.

I had to disable the test case for nested loop signal dispatching for the event extension due to an issiue with epoll. All other test cases are working out fine. My question is: Does the loop implementation still conform to the specification or do i have to remove the entire signal handling support from the event-extension-based loop?

bwoebi commented 7 years ago

@martinschroeder I wonder, is there no workaround?

a) You could shut the warning up with @ and enable/disable the signal watchers when Driver::run() is entered/left (so that always the signal handler of the previous loop is taking priority if there was one) b) you could fall back to pcntl signals [ :-( ]

ghost commented 7 years ago

@bwoebi I will have a look into the enable/disable solution tomorrow, sounds like a good idea to me.

AndrewCarterUK commented 7 years ago

I think working on consumers is as important, if not more, than working on implementations. The best approach from here would be refactoring a collection of async PHP apps to use this event loop.

I've got a PHP snake game that uses React which I can try to rewrite - but I am incredibly limited on time at the moment!

ghost commented 7 years ago

I migrated koolkode/async to event loop API version 0.4 and tagged a new release 0.2.10 that provides the event loop implementation.