Bob Weinand
4fe48c8aec
Fix #132 (TypeError calling Driver::disable())
2017-05-19 15:57:49 +02:00
Niklas Keller
39dd36efdc
Fix cancellation token example
2017-05-16 21:46:52 +02:00
Aaron Piotrowski
be2a9f8c07
Merge pull request #130 from amphp/cancellation
...
Implement cancellation primitives, resolves #125
2017-05-16 11:32:42 -05:00
Aaron Piotrowski
086f045003
Remove event to stream map
...
Unnecessary as the watcher object is available in cancel().
2017-05-16 11:22:40 -05:00
Bob Weinand
6e52f3e211
Fix potential issues when operating on destroyed uv handles in shutdown sequence
2017-05-16 18:17:12 +02:00
Aaron Piotrowski
de783b8eb1
Do not call uv_* functions on expired timers
2017-05-15 12:41:43 -05:00
Niklas Keller
61a7596106
Implement cancellation primitives, resolves #125
2017-05-14 23:07:49 +02:00
Aaron Piotrowski
40299959bf
Remove calls to uv_close()
...
Watchers are closed on garabage collection if necessary.
2017-05-13 10:12:03 -05:00
Aaron Piotrowski
51ab8cb134
Only poll again on UV_EAGAIN
2017-05-13 10:11:00 -05:00
Aaron Piotrowski
3f1f9f41ca
Do not call uv_close() if other watchers on the same stream exist
2017-05-11 10:39:31 -05:00
Niklas Keller
50b37b23ef
Add asyncCall
2017-05-03 15:21:49 +02:00
Niklas Keller
28820fa459
Ignore __destruct for coverage
2017-05-02 19:30:34 +02:00
Niklas Keller
783fe8c4f4
✅ Add asyncCoroutine and ReactPromise tests
2017-05-02 18:59:52 +02:00
Niklas Keller
141875b133
🔥 Kill pipe and capture
...
Use Amp\call instead.
2017-05-02 18:32:59 +02:00
Aaron Piotrowski
835e617054
More stream → iterator
...
Hopefully that's all of them…
2017-05-02 07:07:43 +02:00
Aaron Piotrowski
da9b724f5b
getIterator → iterate
2017-05-02 07:07:43 +02:00
Aaron Piotrowski
91c8da9fec
Replace more occurrences of stream
2017-05-02 07:07:43 +02:00
Aaron Piotrowski
f78328822c
Allow for debugging of double iterator completion
2017-05-02 07:07:43 +02:00
Aaron Piotrowski
45481a710c
Squash leftover Stream references
2017-05-02 07:07:33 +02:00
Aaron Piotrowski
38d53304ae
Stream → Iterator
2017-05-02 07:07:20 +02:00
Aaron Piotrowski
4992d3ebac
Update stream tests
2017-05-02 07:06:20 +02:00
Aaron Piotrowski
a096a36f9a
Emitter::resolve → Emitter::complete
2017-05-02 07:04:30 +02:00
Aaron Piotrowski
7e6eb3689e
Update stream functions
2017-05-02 07:04:30 +02:00
Aaron Piotrowski
4935dddc84
Refactor Streams
...
Dropped original Stream interface in favor of the Iterator interface. Eliminates subscriber timing issues and simplifies Stream usage.
2017-05-02 07:04:10 +02:00
Niklas Keller
1286087c06
Rename Pause to Delayed
...
Pause doesn't cover the delayed value use case.
2017-05-02 07:02:02 +02:00
Aaron Piotrowski
45476b76a4
Reuse watcher resources when possible
...
Previously, disabling the sole read or write watcher for a stream would result in a duplicate UV-watcher for that stream being created. This keeps track of which UV-watchers are associated with a stream until the watcher is cancelled (not just disabled).
2017-04-24 19:19:22 -05:00
Aaron Piotrowski
e1491b1925
Handle invalid yield like a failed promise
2017-04-24 13:08:30 -05:00
Aaron Piotrowski
34192ceca5
Drop Coroutine::dispose()
2017-04-24 11:10:05 -05:00
Niklas Keller
79ab41e5bf
Update php-cs-fixer to version 2 and upgrade rules
...
This also fixes the code style according to the new rules.
2017-04-24 16:22:02 +02:00
Niklas Keller
e9d48a68d5
Rename createRunnable to asyncCoroutine and createCallable to coroutine
2017-04-24 15:27:04 +02:00
Niklas Keller
dc21d094c5
Throw error in case the loop throws during wait
2017-04-24 15:27:04 +02:00
Niklas Keller
e1c63c62f4
Minor documentation changes
2017-04-24 15:27:04 +02:00
Niklas Keller
65a37484a2
Replace UnionTypeError with factory function + minor doc changes
2017-04-24 15:27:04 +02:00
Niklas Keller
70e63a3748
Fix code style according to new rules
2017-04-24 15:27:04 +02:00
Niklas Keller
dfa40f5b00
Rename wrap to createRunnable and coroutine to createCallable
2017-04-24 15:27:04 +02:00
Niklas Keller
4f8b656513
Document wrap and coroutine better by explicitly naming the differences
2017-04-24 15:27:04 +02:00
Aaron Piotrowski
a562d6b20f
Use same poll for read and write watchers
...
Changed values of Watcher constants to match UV constants because it was easier that way. :-D
2017-04-21 10:54:53 -05:00
Aaron Piotrowski
fdeb427717
Use simple assignment if queue is empty
...
The common case is for the queue to be empty at the start of the tick, so a call to array_merge() can be avoided in most cases.
2017-04-20 11:26:13 -05:00
Aaron Piotrowski
628d8cbab1
Set next "now" at the beginning of watcher activation
2017-04-20 11:13:17 -05:00
Aaron Piotrowski
4792bf52fe
Emulate "now" behavior of libuv/libev in NativeDriver and EventDriver
...
Timers created while not running when using NativeDriver and EventDriver will include the elapsed time before run() is called. This matches the behavior of EvDriver and UvDriver. Addresses #113 .
2017-04-19 17:21:23 -05:00
Aaron Piotrowski
89570e8f6d
Move Watcher to Loop namespace
2017-04-18 09:38:16 -05:00
Ciaran Kelly
0e4d4b492e
Add missing namespace declarations
2017-04-15 23:16:50 +01:00
Bob Weinand
61b88a780e
Merge remote-tracking branch 'origin/kelunik-v2-review'
2017-04-15 00:42:07 +02:00
Aaron Piotrowski
38a6066e53
Remove Message
2017-04-14 09:23:47 -05:00
Niklas Keller
fed09e42ac
Fix line lengths
2017-04-13 18:49:32 +02:00
Niklas Keller
5e545301cd
Rename Listener to StreamIterator
2017-04-13 18:20:46 +02:00
Niklas Keller
3a42254300
Make Watcher implement Struct
2017-04-13 18:05:59 +02:00
Niklas Keller
3e8b37f21f
Remove Amp\Stream\interval and add delay option to fromIterable
2017-04-13 18:05:41 +02:00
Niklas Keller
b810ff1034
Use eval to prevent multiple definitions warnings for Emitter and Deferred
2017-04-13 18:04:51 +02:00
Aaron Piotrowski
a0b8de40fb
Null deferred refs
2017-04-07 12:50:01 -05:00