Aaron Piotrowski
822995a69b
Remove InvalidYieldError
...
Unused.
2020-10-02 22:49:41 -05:00
Niklas Keller
55af98a8ba
Simplify Coroutine
2020-09-29 21:13:30 +02:00
Aaron Piotrowski
0eceb48fad
Refactor internal traits as classes
...
Trait tests should test Deferred and Emitter instead, will update with other tests.
2020-09-26 23:14:17 -05:00
Aaron Piotrowski
b65823e0bb
Refactor Coroutine to use await()
...
Dropped polyfill, ext-fiber will be required to run any v3 code.
2020-09-26 22:22:07 -05:00
Aaron Piotrowski
5f6db028ab
Initial fiber support
2020-09-24 12:53:32 -05:00
Niklas Keller
0e04422dcb
Increase psalm error level to level 4
2020-03-28 20:27:42 +01:00
Niklas Keller
01cd49994f
Add further generics for static analysis
2020-03-28 13:52:48 +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
5dcdd83959
Declare variables as static within function
2019-05-31 11:38:02 -05:00
Niklas Keller
944a2dd29d
Move Coroutine::__destruct to Placeholder
2019-05-31 11:38:02 -05:00
Niklas Keller
58c7bfb689
Improve try / catch nesting
2019-05-31 11:38:02 -05:00
Niklas Keller
c12828081f
Fix exceptions bubbling from Coroutine::__destruct
...
This has been an edge case potentially hiding some exceptions. The tests have been refactored to error if the loop has watchers leaking from one test to another test.
2019-05-31 11:38:02 -05:00
Niklas Keller
fa3fe1d20b
Apply PSR-2
2018-06-18 20:00:01 +02:00
Aaron Piotrowski
05491a57c9
Optimize fast-finishing/failing coroutines
2017-08-04 22:50:19 -05:00
Aaron Piotrowski
5bca41ade4
Cleaner coroutine continuation
2017-05-22 12:28:29 -05:00
Bob Weinand
26dfafe00c
Avoid coroutine callstack explosion upon yielding succeeded Promises
2017-05-20 16:31:49 +02:00
Niklas Keller
9d18a1f8bd
Readd missing depth property
2017-05-20 09:46:01 +02:00
Niklas Keller
e8e26d79e7
Revert "Drop max continuation depth"
...
This reverts commit cdf28fa938
.
As streams always buffer before applying backpressure, these might
result in a stack overflow. Another example is file streaming with
the blocking driver, which always immediately succeeds.
2017-05-20 09:40:56 +02: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
65a37484a2
Replace UnionTypeError with factory function + minor doc changes
2017-04-24 15:27:04 +02:00
Aaron Piotrowski
d01ee68dd2
Null circular reference on resolution
2017-04-06 09:24:21 -05:00
Aaron Piotrowski
cdf28fa938
Drop max continuation depth
...
It seems unlikely a real-world application would run out of memory due to call stack depth for normal coroutine continuations (that is, where infinite recursion is not root problem). Hopefully time will not prove me wrong…
2017-03-30 23:45:54 -05:00
Niklas Keller
ce269fa516
Rename Promise::when to Promise::onResolve, resolves #77
2017-03-21 17:23:37 +01:00
Aaron Piotrowski
39b95255d2
Reduce code duplication in Coroutine
...
Hot path is still duplicated for performance, but conversion of non-promise values to promises should be a single method.
2017-03-15 19:10:23 -05:00
Aaron Piotrowski
a927b3cb06
Separate functions into Promise and Stream namespaces
2017-03-15 19:02:04 -05:00
Aaron Piotrowski
6b9ec609c1
Add UnionTypeError
2017-03-14 13:15:31 -05:00
Niklas Keller
e8ea4e2ba9
Implement yielding arrays as implicit all operator, fixes #68
2017-03-12 19:42:25 +01:00
Aaron Piotrowski
7ad10f5d7d
Add support for React promises
2017-03-11 09:17:43 -06:00
Niklas Keller
0be9ae9ade
Switch from AsyncInterop\Promise to Amp\Promise
2017-03-10 21:58:46 +01:00
Niklas Keller
e64bbfb9f5
Add Loop::set, auto-wrapping, fixup things
2017-03-10 21:31:57 +01: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
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
Niklas Keller
bd7e84a138
Improve error messages
2016-12-11 16:12:42 +01:00
Aaron Piotrowski
9927ad5b4f
Awaitable → Promise
2016-11-14 13:59:21 -06:00
Aaron Piotrowski
96e1178b89
Code, docblock, and comment cleanup
2016-08-17 22:25:54 -05:00
Aaron Piotrowski
bdc26e1e8b
Combine use statements
2016-08-16 13:07:51 -05:00
Aaron Piotrowski
888229d667
Use strict types
2016-08-15 23:46:26 -05:00
Bob Weinand
6a87658ad8
Remove bogus .coveralls.yml file
2016-08-15 15:41:28 +02:00
Niklas Keller
cef92e9770
Doc fixes for Coroutine
2016-08-14 19:17:08 +02:00
Aaron Piotrowski
69ec812bc0
Require PHP 7
2016-08-11 14:52:40 -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
7fb57141d2
Cleanup yielded value handling
2016-06-02 10:46:22 -05:00
Aaron Piotrowski
055d7d4c52
Update docblocks
2016-06-01 12:18:11 -05:00
Aaron Piotrowski
b705c144c6
Minor tweaks
2016-06-01 12:06:43 -05:00
Aaron Piotrowski
ccec7acc94
Remove Exception namespace
2016-05-24 10:39:19 -05:00
Aaron Piotrowski
6d263ffb84
Drop Awaitable from namespace
2016-05-23 22:48:28 -05:00
Aaron Piotrowski
8b42994ec9
Fix exception creation
2016-05-23 21:36:29 -05:00
Aaron Piotrowski
b4ea37576e
Execute after CoroutineResult
2016-05-22 09:25:40 -05:00