Aaron Piotrowski
5d0adebaa2
Add isDebugEnabled function
2020-09-24 12:53:30 -05:00
Niklas Keller
603ce25299
Fix invalid types in doc comments
...
We're on the way to psalm error level 4, but there are still some remaining issues.
2020-03-28 14:32:53 +01:00
Niklas Keller
71d7f5674c
Increase psalm error level to level 5
2020-03-28 14:25:39 +01:00
Niklas Keller
a75164b66b
Add psalm static analysis on level 6
...
This also fixes mixed types in some cases.
2020-03-28 12:23:46 +01:00
Aaron Piotrowski
a726db92a5
Only create deferred for backpressure if necessary
2019-09-21 18:30:14 +02:00
Niklas Keller
c45cd5a3a9
Fix backpressure release
...
Previously, backpressure was only released once advance() was called
again. This means the last backpressure item was never free'd in case
the caller knows there are no more items to consume and didn't call
advance() the last time.
2019-09-21 18:30:14 +02:00
Niklas Keller
fa3fe1d20b
Apply PSR-2
2018-06-18 20:00:01 +02:00
Niklas Keller
5dac863f37
Don't record stack traces in case of AMP_DEBUG not being set ( #218 )
...
Fixes #217 .
2018-04-26 00:32:31 +02:00
Aaron Piotrowski
4ef9af6dff
Check against "false"
2017-12-02 11:15:06 -06:00
Aaron Piotrowski
745a95ba67
Define AMP_DEBUG through environment
2017-12-02 10:23:12 -06:00
Niklas Keller
783fe8c4f4
✅ Add asyncCoroutine and ReactPromise tests
2017-05-02 18:59:52 +02:00
Aaron Piotrowski
835e617054
More stream → iterator
...
Hopefully that's all of them…
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
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
70e63a3748
Fix code style according to new rules
2017-04-24 15:27:04 +02:00
Aaron Piotrowski
2f7e9a0746
Run returned generator as coroutine from onResolve and onEmit callbacks
2017-03-27 18:37:55 -05:00
Niklas Keller
2aa91a6c25
Rename Stream::listen to Stream::onEmit
2017-03-21 18:29:51 +01:00
Niklas Keller
ce269fa516
Rename Promise::when to Promise::onResolve, resolves #77
2017-03-21 17:23:37 +01:00
Aaron Piotrowski
a927b3cb06
Separate functions into Promise and Stream namespaces
2017-03-15 19:02:04 -05:00
Niklas Keller
77bd05b807
Fix tests and Producer React adaption
2017-03-12 22:09:19 +01:00
Aaron Piotrowski
7ad10f5d7d
Add support for React promises
2017-03-11 09:17:43 -06:00
Aaron Piotrowski
754a29e86c
Remove promise error handler
...
Exceptions thrown from when callbacks are now forwarded directly to the loop error handler.
2017-03-10 15:32:58 -06:00
Niklas Keller
0be9ae9ade
Switch from AsyncInterop\Promise to Amp\Promise
2017-03-10 21:58:46 +01:00
Aaron Piotrowski
cf5ebb1408
Better error message when emitting after resolve
2017-01-07 12:25:04 -06:00
Niklas Keller
ae69e92266
Update to promise 0.4.0 and event-loop 0.5.0, add humbug config
2017-01-07 13:47:45 +01:00
Aaron Piotrowski
210b6ff258
Observable → Stream
2017-01-03 19:10:27 -06:00
Aaron Piotrowski
5651240615
Update to promise spec v0.3
...
Dropped strict-types due to spec requiring weak types in callbacks.
2016-12-29 16:29:27 -06:00
Aaron Piotrowski
9927ad5b4f
Awaitable → Promise
2016-11-14 13:59:21 -06:00
Aaron Piotrowski
759af93112
Missed static; remove unused import
2016-09-07 12:24:49 -05:00
Aaron Piotrowski
6e1c1db5a6
Drop special behavior when emitting an observable
2016-08-23 13:17:59 -05:00
Aaron Piotrowski
96e1178b89
Code, docblock, and comment cleanup
2016-08-17 22:25:54 -05:00
Aaron Piotrowski
d4e83490c2
Drop unsubscribing from Observable
2016-08-17 21:11:03 -05:00
Aaron Piotrowski
2317a3aa37
Unsubscribe from emitted observable if failed
2016-08-16 16:31:09 -05:00
Aaron Piotrowski
84c2572e0a
Prevent fail call after resolution
2016-08-16 13:30:32 -05:00
Aaron Piotrowski
dae4eb90da
Better Emitter fix; fail observable if emitted awaitable fails
2016-08-16 13:07:38 -05:00
Aaron Piotrowski
a8a5a1b3a5
Fix Emitter
2016-08-16 02:28:47 -05:00
Aaron Piotrowski
888229d667
Use strict types
2016-08-15 23:46:26 -05:00
Bob Weinand
dcf17e3f98
Optimize Producer & remove wait until first subscribe
...
Also delay first emit in Emitter until next tick
2016-08-14 16:57:17 +02: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
Aaron Piotrowski
24142496d8
Rethrow subscriber callback exceptions from loop
2016-07-19 15:13:56 -05: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
548a9fd556
Fix bug when emitting failed awaitable and waiting for a subscriber
2016-06-02 17:05:22 -05:00
Aaron Piotrowski
cef5c90168
Drop disposable interface; rename dispose() to unsubscribe()
2016-06-02 10:42:22 -05:00