Daniel Lowrey
7ce6734976
Fix potential illegal offset access
2015-06-10 15:32:02 -04:00
Bob Weinand
80fb080470
I/O watchers must be always cleared, even if disabled
...
Not clearing I/O watcher lead to a leftover disabled watcher, so that streamIdPollMap still contains a disabled watcher with the flag.
Which may lead to a new watcher of same type not triggering an uv_poll_start().
2015-06-10 20:10:33 +02:00
Daniel Lowrey
f2a0488d87
Add Amp\promises() to coalesce values/promises/promisors to promises
2015-06-09 11:49:22 -04:00
Daniel Lowrey
1ac3d96d24
Remove Exception hint because it breaks on PHP7 BaseException
2015-06-08 15:11:17 -04:00
Daniel Lowrey
e923ea3fde
minor timeout function/test cleanup
2015-05-31 20:18:42 -04:00
Daniel Lowrey
34088cbf52
Add timeout() function
2015-05-31 20:13:39 -04:00
Daniel Lowrey
905d5bfc2c
update docblock
2015-05-31 19:51:09 -04:00
Daniel Lowrey
954eaabcf5
Make promise updates variadic (ugly)
2015-05-31 19:33:55 -04:00
Daniel Lowrey
48d8aaf0e5
Correctly clear UvReactor once() watchers
2015-05-31 12:06:25 -04:00
Daniel Lowrey
31f21da9e9
Improve Deferred performance switching
2015-05-27 22:03:08 -04:00
Daniel Lowrey
0c4f04c6ab
Fix missing parameter if coroutine invoked without args
2015-05-27 18:33:57 -04:00
Bob Weinand
6c440b2797
Fix fatal error upon wrong key type
2015-05-27 23:36:22 +02:00
Daniel Lowrey
05e3ecc423
Fix bug incorrectly clearing repeat watcher when disabled
2015-05-26 03:03:32 -04:00
Daniel Lowrey
5e7d6ff095
Fix coroutine fatal if initial advance errored
2015-05-25 12:51:50 -04:00
Daniel Lowrey
0c0395f7a0
Fix UvReactor bugs
2015-05-25 12:47:04 -04:00
Daniel Lowrey
f024061d22
Fix buggy PromiseStream behavior
2015-05-23 16:46:55 -04:00
Daniel Lowrey
35a601964e
don't use 0b constant values because bitwise comparisons aren't used
2015-05-20 21:28:34 -04:00
Daniel Lowrey
e8ac57db31
make function name consistent with others
2015-05-20 20:09:30 -04:00
Daniel Lowrey
29cde175b3
Minor coroutine resolution updates
2015-05-20 19:51:03 -04:00
Daniel Lowrey
c86d6cc930
don't swallow caught exception
2015-05-20 18:29:45 -04:00
Daniel Lowrey
0255049bbb
Don't use php7 ReflectionGenerator in PHP5.x branch
2015-05-20 18:19:23 -04:00
Daniel Lowrey
e6f1386b31
Fix double promisor resolve under error condition
2015-05-20 18:16:42 -04:00
Daniel Lowrey
71f9687cff
Reactor watcher option "callback_data" renamed "cb_data"
2015-05-20 15:21:59 -04:00
Daniel Lowrey
c7e4e8d0c3
Miscellaneous function changes (more after jump)
...
- Combinator functions optimized for performance
- Amp\reactor() now accepts an optional assignment parameter for
modifying the global default event reactor instance to allow for
third-party Reactor implementations.
- Renamed functions:
. Amp\getReactor() -> Amp\reactor()
- Removed functions:
. Amp\chooseReactor()
. Amp\tick()
. Amp\immediately()
. Amp\once()
. Amp\repeat()
. Amp\onReadable()
. Amp\onWritable()
. Amp\onSignal()
. Amp\enable()
. Amp\disable()
. Amp\cancel()
2015-05-20 15:18:30 -04:00
Daniel Lowrey
9fa6010f19
Optimize non-promise pipe() case
2015-05-19 23:12:32 -04:00
Daniel Lowrey
c8d6a0b5b3
Optimize coroutine resolution for performance
2015-05-19 23:07:29 -04:00
Daniel Lowrey
fc600d46ab
Pass optional data parameter to when/watch callbacks
2015-05-19 18:49:38 -04:00
Daniel Lowrey
879b1229d1
Minor PromiseStream fixes
2015-05-19 16:20:53 -04:00
Daniel Lowrey
ca82ac5362
Fix NativeReactor bug breaking tick sleep timing
2015-05-19 16:13:53 -04:00
Daniel Lowrey
44d52cdf2f
Rename AMP_DEBUG -> AMP_PRODUCTION_MODE
2015-05-19 14:56:22 -04:00
Daniel Lowrey
de905a6104
Correct Pause implementation for use with new trait system
2015-05-19 14:10:53 -04:00
Daniel Lowrey
7e16326871
remove scalar typehint from 5.x-compatible code
2015-05-19 14:05:41 -04:00
Daniel Lowrey
e3e01c993c
Add Amp\Streamable interface for buffered generator resolution
2015-05-19 12:03:26 -04:00
Daniel Lowrey
2a0486cb3c
Add Amp\pipe() function to pipe eventual results through a functor
2015-05-19 11:31:01 -04:00
Daniel Lowrey
30245d6817
Add optional callback data param in Deferred::__construct()
2015-05-19 11:16:04 -04:00
Daniel Lowrey
1ed5e69c52
Move buffering to PromiseStream for custom behavior in extended instances
2015-05-19 01:09:23 -04:00
Daniel Lowrey
68719d8023
Unresolved -> PrivatePlaceholder
2015-05-19 00:29:27 -04:00
Daniel Lowrey
953c4612e6
Future -> Deferred
2015-05-19 00:21:33 -04:00
Daniel Lowrey
3af013d418
Expose boolean AMP_DEBUG for performance tuning
...
Amp Future instances double both as Promisor and Promise
implementations when AMP_DEBUG is defined and set to false.
This switch allows private Promise resolution safety by
default at the expense of performance.
Amp applications should set AMP_DEBUG to false in production
environments to maximize performance.
2015-05-18 23:57:34 -04:00
Daniel Lowrey
0973bba5ef
Add PromiseStream to stream Promise updates without callback hell
2015-05-18 17:39:09 -04:00
Daniel Lowrey
02e85b29c6
Fix high cpu usage in timer loop from broken "nextTimerAt" caching
2015-05-18 11:40:09 -04:00
Daniel Lowrey
aa27ab7a10
Fixed bug causing every NativeReactor tick to last one second (lol)
2015-05-17 19:52:41 -04:00
Daniel Lowrey
631a6089d9
Resolve correct Success arg in empty any\(\) combinator
2015-05-15 15:59:57 -04:00
Daniel Lowrey
93eb8ad8de
Suggest nearby property name in Struct error messages
2015-05-13 10:05:56 -04:00
Daniel Lowrey
2c3a3e65bd
Add offending generator key to coroutine resolution error messages
2015-05-13 01:15:35 -04:00
Daniel Lowrey
4a45502ae9
Correctly update nextTimerAt timestamp for repeat watchers
2015-05-10 02:36:39 -04:00
Daniel Lowrey
ed6084c333
Fix incorrect additional increment
2015-05-10 00:54:02 -04:00
Daniel Lowrey
cddb8e9f08
Backport API changes to 5.5+ compat
2015-05-04 12:48:29 -04:00
Daniel Lowrey
b9819d85b4
kill reference to removed function
2015-04-29 13:45:06 -04:00
Daniel Lowrey
06981ab6ea
fix bad anon class syntax
2015-04-29 11:24:26 -04:00