1
0
mirror of https://github.com/danog/amp.git synced 2024-12-14 02:17:26 +01:00
Commit Graph

1427 Commits

Author SHA1 Message Date
Aaron Piotrowski
7bc08b9a6a Replace leftover LogicExceptions exceptions with Error 2016-08-12 16:58:53 -05:00
Aaron Piotrowski
496152282e Update Amp\coroutine() tests 2016-08-12 16:56:13 -05:00
Aaron Piotrowski
2ff32c2d6b Remove unnecessary default parameter values 2016-08-12 16:38:36 -05:00
Aaron Piotrowski
66c38e1480 Refactor Amp\coroutine()
Any function can now be passed to this function, which now returns a function returning an awaitable.
2016-08-12 14:50:44 -05:00
Aaron Piotrowski
69ec812bc0 Require PHP 7 2016-08-11 14:52:40 -05:00
Aaron Piotrowski
658edf33f7 Use Closure::fromCallable() in 7.1 2016-08-11 13:33:51 -05:00
Bob Weinand
dff456ce83 Merge pull request #89 from async-interop/state
Rename fetch/storeState to get/setState
2016-08-10 12:18:56 +01:00
Aaron Piotrowski
ea66677a50 Update for Driver changes in spec 2016-08-06 08:58:37 -05:00
Niklas Keller
74e2577b25 Rename fetch/storeState to get/setState 2016-08-06 14:49:08 +02:00
Cees-Jan Kiewiet
4bdc40e9c1 Merge pull request #87 from async-interop/driver-registry-merge
Merge Registry into Driver
2016-08-06 14:31:44 +02:00
Niklas Keller
8ece6be6cf Make final PSR-2 compatible 2016-08-05 14:11:59 +02:00
Niklas Keller
39b7ddd366 Make abstract PSR-2 compatible 2016-08-05 13:56:26 +02:00
Niklas Keller
6cde9f5495 Merge Registry into Driver 2016-08-04 21:08:52 +02:00
Aaron Piotrowski
aa7b76e842 Add awaitable/coroutine-aware loop functions
These functions mirror the standard loop methods, but run returned Generators as coroutines and invoke rethrow() on returned awaitables.
2016-08-02 12:48:32 -05:00
Aaron Piotrowski
13908fe2e5 Add concat() function 2016-08-01 11:10:59 -05:00
Aaron Piotrowski
9055f159e7 Revert some() to v1 behavior 2016-07-31 00:31:04 -05:00
Cees-Jan Kiewiet
6b1da28fb8 Merge pull request #84 from async-interop/signal_handlers_in_different_loops
Add a warning/implementation note about installing handlers for a same signal on different loops
2016-07-30 20:50:01 +02:00
Aaron Piotrowski
bf716f4efe Merge pull request #48 from mickaelandrieu/patch-1 2016-07-25 11:17:40 -05:00
Aaron Piotrowski
5da5fd5662 Update phpunit version 2016-07-25 11:11:35 -05:00
Aaron Piotrowski
19e6440897 Fix native loop timers 2016-07-25 10:09:40 -05:00
Mickaël Andrieu
c3674022bd updated PHP CS Fixer to new organization 2016-07-23 00:43:16 +02:00
Aaron Piotrowski
0925a59db2 Update branch alias 2016-07-20 08:53:58 -05:00
Aaron Piotrowski
c2caca9d02 Fix functions using Subscriber as Awaitable
Use PHP_INT_MAX instead of 0 for infinite interval() count.
2016-07-20 08:53:18 -05:00
Aaron Piotrowski
7adc7d8452 Remove missed emit() default value 2016-07-20 08:52:19 -05:00
Aaron Piotrowski
8e794ba1d7 Fix stream() 2016-07-19 15:24:05 -05:00
Aaron Piotrowski
24142496d8 Rethrow subscriber callback exceptions from loop 2016-07-19 15:13:56 -05:00
Bob Weinand
1642bf9195 s/settle/any/ which now returns [$errors, $succeeds] 2016-07-19 21:39:09 +02:00
Aaron Piotrowski
bec838b693 Remove leftover exception class
No longer needed as Subscriber is not an awaitable.
2016-07-19 13:30:28 -05:00
Aaron Piotrowski
70123b9a44 Update Producer::resolve(); fix emitting observable 2016-07-19 13:19:44 -05:00
Aaron Piotrowski
9839343bbb Remove default value from emit 2016-07-19 13:10:15 -05:00
Aaron Piotrowski
13a6fc59c4 Producer::init() -> private 2016-07-19 12:42:58 -05:00
Aaron Piotrowski
32b4721c5e Subscriber no longer implements Awaitable 2016-07-19 12:40:16 -05:00
Aaron Piotrowski
90d744537e protected -> private in internal traits 2016-07-19 12:32:43 -05:00
Aaron Piotrowski
3e170639c3 Remove final from Observer and Subscriber 2016-07-19 11:58:20 -05:00
Bob Weinand
9f3f6b9523 Add a warning/implementation note about installing handlers for a same signal on different loops
This needs to be undefined behavior as we do not have the possibilities in PHP (i.e. the language and functions don't give us the power) to distinguish properly whether a signal is already installed or not
Also, when we try to set a handler for a signal we've already installed a signal elsewhere, the second onSignal() call will lead implementations to override the original handler (on the system level, with signal()/sigaction())
Ultimately some extensions just flat out emit a warning in that case (e.g. libev).

Thus, we cannot control what happens and hence this needs to be specified as undefined behavior.
2016-07-19 18:10:51 +02:00
Aaron Piotrowski
5a06b1cdc1 Update tests and remove unused tests 2016-07-19 00:05:40 -05:00
Aaron Piotrowski
dad93a6da0 Merge branch 'observable' into v2 2016-07-18 23:29:19 -05:00
Aaron Piotrowski
b9d554dd7b Add more functions 2016-07-18 23:23:25 -05:00
Aaron Piotrowski
c561197d1d Remove unused v1 files 2016-07-18 23:22:07 -05:00
Aaron Piotrowski
ade997688a Merge branch 'awaitable' into v2 2016-07-18 23:20:05 -05:00
Niklas Keller
8f38808ddb Fix line lengths, resolves #76 (#81) 2016-07-15 22:17:24 +02:00
Aaron Piotrowski
3f654cbd5b Initial tests plus some fixes 2016-07-12 11:20:06 -05:00
Bob Weinand
3603d5b1ec EvLoop::enabled() -> supported() 2016-06-26 17:35:25 +02:00
Bob Weinand
e089d8e267 Add line break to prevent overlong line 2016-06-26 17:19:54 +02:00
Bob Weinand
d6c299a448 Update according to latest spec changes + better signal tests 2016-06-26 17:12:33 +02:00
Aaron Piotrowski
8c9efe42aa Undefined callback order (#80) 2016-06-26 16:15:01 +02:00
Aaron Piotrowski
2a1fde0b44 Add automatic loop factory bootstrap 2016-06-23 23:37:06 -05:00
Aaron Piotrowski
b0435d221f Merge pull request #78 from async-interop/watcher-activation
Specify when exactly a watchers callbacks may start to be called
2016-06-21 14:02:28 -05:00
Aaron Piotrowski
4ed8e65468 Cleaner resolution 2016-06-16 23:27:14 -05:00
Aaron Piotrowski
92767755ee Avoid loosing exception thrown from generator after invalid yield 2016-06-16 22:44:32 -05:00