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

1141 Commits

Author SHA1 Message Date
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
Aaron Piotrowski
f553e4f08b Improve coroutine continuation
Duplicated some code for faster coroutine continuation.
2016-06-14 23:26:59 -05:00
Aaron Piotrowski
ae182165e5 Remove circular reference check 2016-06-14 21:53:50 -05:00
Aaron Piotrowski
60d560d70e Add $className param to capture(); other cleanup 2016-06-14 21:40:04 -05:00
Aaron Piotrowski
986b69907f No need to call keepalive within EvLoop
Loop class handles the details necessary to stop the loop if no reference watchers exist.
2016-06-09 12:59:18 -05:00
Aaron Piotrowski
33338324d4 Add UvLoop 2016-06-09 12:57:46 -05:00
Aaron Piotrowski
666cc42a5f Better ref/unref in EvLoop; fix EvLoopTest 2016-06-08 16:03:37 -05:00
Aaron Piotrowski
543d1c5e66 Fix repeat timer interval 2016-06-08 12:08:00 -05:00
Aaron Piotrowski
a49d333f1b Add EvLoop; Split shared components into Loop 2016-06-08 09:22:14 -05:00
Aaron Piotrowski
757778c848 Fix check if signal was disabled
Plus some minor tweaks
2016-06-08 00:15:36 -05:00
Bob Weinand
7b30e788bb Specify when exactly a watchers callbacks may start to be called
Delaying activation of watchers to the next tick guarantees consistent behavior between all implementations.

Additionally it eliminates the following problem:
- Two defer()'s are set up with the first one immediately disabled
- Second defer()'s callback is called and enables the first defer()'s watcher
- Executes defer() in same tick or next tick?
If the answer is same tick, what happens in the following scenario:
- An immediately disabled defer() and a delay($msDelay = 0) are set up
- The delay()'s callback enables the defer()'s watcher
- Executes defer() callback in same tick or next tick?
Doing it in same tick violates the requirement that defers are called before any other watchers in the same tick.

We get similar problems with e.g. delay() and repeat() (if their timer all expired now, but we require order to be preserved).

Thus we need to pretty much delay the activation of enable() to the next tick to avoid potential ambiguity or different behaviors depending on when exactly the enable() or watcher registration happened.
2016-06-07 21:17:27 +02:00
Aaron Piotrowski
d50de887a2 Fix onSignal porition of testNoMemoryLeak 2016-06-07 13:21:10 -05:00
Bob Weinand
e912117f8d Reduce number of runs for memory test 2016-06-07 19:47:08 +02:00
Aaron Piotrowski
8e31310921 Fix repeat timer memory leak 2016-06-07 12:40:35 -05:00
Aaron Piotrowski
6fd7fe5b11 Call posix_kill() in defer for better consistency
Using a short delay was sometimes not long enough to ensure that $sig2 was actually enabled before the signal was sent. Using a defer after enabling pushes the call to posix_kill() to the next tick.
2016-06-07 12:31:49 -05:00
Aaron Piotrowski
8c2063157b Fix testEventsNotExecutedInSameTickAsEnabled 2016-06-07 12:25:59 -05:00
Aaron Piotrowski
93424c1c6e Enable events in next tick 2016-06-07 12:24:53 -05:00
Aaron Piotrowski
f940934a0b Update for latest standard changes
Plus some minor tweaks and more docs.
2016-06-07 00:18:59 -05:00
Aaron Piotrowski
cd0a03c0b2 Fix exception name / warning 2016-06-07 00:08:55 -05:00
Bob Weinand
085afe050e Add registry, execution order tests and InvalidWatcherException handling 2016-06-07 01:53:28 +02:00
Bob Weinand
1e584697b3 Be a little more specific about enable/definition
Enable is when things get put back to the queue, hence that order shall be respected. Otherwise we get undefined behaviors when disabling deferreds which have yet to be executed and re-enabling them after the point they should have been executed.
2016-06-07 01:44:28 +02:00
Andrew Carter
ccb2180184 Clarified that cancel() can be used to prevent a memory leak (#75) 2016-06-06 22:37:17 +02:00
Aaron Piotrowski
289b0fe603 Merge pull request #74 from async-interop/calltime_guarantees
Specify exact guarantees when a callback has to be called
2016-06-05 22:45:14 -05:00
Aaron Piotrowski
c05ba0daa9 Merge pull request #72 from async-interop/invalid-watcher-handling
(Re-)Introduce InvalidWatcherException
2016-06-05 22:44:42 -05:00
Aaron Piotrowski
d29e175189 Merge pull request #71 from async-interop/defer-delay-invalidation-note
Add the invalidation note on defer/delay
2016-06-05 22:44:20 -05:00
Bob Weinand
cf012501a2 Specify exact guarantees when a callback has to be called
This prevents unexpected failures due to different execution orders in different implementations.
2016-06-04 20:28:25 +02:00
Bob Weinand
c9af067b46 Fix delays/intervals being able equal to zero 2016-06-04 00:10:47 +02:00
Bob Weinand
cca8008cba Fix memory leak test
Add check for signal test
2016-06-04 00:07:16 +02:00
Aaron Piotrowski
6a9ec4ea9f PSR-2: tabs -> spaces 2016-06-03 10:01:21 -05:00
Aaron Piotrowski
666bb332e1 Fix some bugs, refactor disable/unreference 2016-06-03 10:00:29 -05:00
Aaron Piotrowski
ffe714f1ef Fix some tests; PSR-2 function definitions 2016-06-03 00:49:47 -05:00
Aaron Piotrowski
808ce32e3c Fix leftover mentions of Disposable 2016-06-02 17:11:25 -05:00
Aaron Piotrowski
548a9fd556 Fix bug when emitting failed awaitable and waiting for a subscriber 2016-06-02 17:05:22 -05:00
Bob Weinand
f6c6f41adf (Re-)Introduce InvalidWatcherException
Fixes #58
2016-06-02 21:56:36 +02:00
Bob Weinand
7cd03f3927 The watcher id must be invalidated before defer and delay callback calls
Fixes #70.
2016-06-02 19:15:52 +02:00
Aaron Piotrowski
7fb57141d2 Cleanup yielded value handling 2016-06-02 10:46:22 -05:00
Aaron Piotrowski
5715bec9e1 Refactor functions with Emitter 2016-06-02 10:43:46 -05:00