1
0
mirror of https://github.com/danog/amp.git synced 2024-11-30 04:29:08 +01:00
Commit Graph

605 Commits

Author SHA1 Message Date
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
a660af794b Annotate that throwIfRequested might throw CancelledException 2019-05-30 15:13:38 +02:00
Aaron Piotrowski
272f78dcb2
Note method to retreive array of exceptions 2019-03-02 09:22:06 -06:00
Aaron Piotrowski
ef83723a79
Fix signal handler in NativeDriver when used with pcntl_async_signals
Fixes #264.
2019-02-25 18:05:47 -06:00
Masiukevich Maksim
0fd6b8c157 Fix phpdoc types for call / asyncCall (#260)
Incorrect types were indicated, due to which static analysis led to false positives.
2019-02-05 18:32:32 +01:00
Aaron Piotrowski
c6f8425473
Use a custom priority queue for timers
Fixes #220 by allowing immediate removal of the watcher from the queue. Insert and extract is O(log(n)), peeking is O(1), and removal is O(n).
2019-01-24 13:09:11 -06:00
Aaron Piotrowski
b6fc1e12d4
Move nowUpdateNeeded setting to getTimeout()
Essentially the same fix as @bwoebi committed, just placed at the source of the problem.
2019-01-21 10:27:49 -06:00
Bob Weinand
c3afc5e977
Fix #256 - Ensure nowUpdateNeeded is set to true after a blocking wait in NativeDriver
So that expired timeouts also indeed do trigger immediately instead of in the next tick.
2019-01-21 16:41:30 +01:00
Bob Weinand
7075ef7d74 Fix #251 - 100% CPU usage in NativeDriver
Also use better bounds for timer - it must not execute before, but may execute a little later (on my system it were up to 7 ms actually)
2018-12-11 11:31:37 +01:00
Niklas Keller
5622edba37 Implement monotonic timer using PHP 7.3's hrtime() 2018-12-10 20:07:11 +01:00
Aaron Piotrowski
5889f4e0fd Randomize loop now offset 2018-11-26 21:59:15 +01:00
Aaron Piotrowski
77a12c823b Add Loop::now() 2018-11-26 21:59:15 +01:00
Sascha-Oliver Prolic
96c2eeaa1f Add Promise\wrap (#234) 2018-11-26 19:36:46 +01:00
Sascha-Oliver Prolic
4a98cc4fde Add timeoutWithDefault function (#245) 2018-11-25 17:56:42 +01:00
Niklas Keller
b73e03bfe2 Rename Iterator\collect to Iterator\toArray 2018-11-25 17:09:50 +01:00
Niklas Keller
22a8332261 Add Iterator\collect 2018-11-25 17:09:50 +01:00
Aaron Piotrowski
c4faf1f347
Update loop time in dispatch() instead of activate()
Fixes #243.
2018-10-14 22:30:31 -05: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
242d78a6ec Fix 212 and ignore unreference on invalid watchers (#216)
Fix #212 & Ignore unreference on invalid watchers
2018-04-12 09:46:52 +02:00
Aaron Piotrowski
9b2fb76442
Free loop handle when destructing EventDriver
Relates to #177.
2018-04-08 13:20:27 -05:00
Aaron Piotrowski
3b12391529
Add note about OR'ing with 4 2018-04-08 13:10:46 -05:00
Aaron Piotrowski
8c8a6da0c2
Invoke watcher callback if events is 0 or 4
4 is UV_DISCONNECT
2018-04-06 14:22:39 -05:00
Niklas Keller
c632e40b03 Clarify promise interface
Fixes #209.
2018-03-25 17:27:41 +02:00
Aaron Piotrowski
22eb14d736
Avoid odd ev event nulling behavior 2018-03-20 09:54:22 -05:00
Aaron Piotrowski
992d6e9b39 Return named classes
Better for var_dump and stack traces.
2018-01-27 19:47:46 +01:00
Aaron Piotrowski
4bbe141718 Hide resolution methods 2018-01-27 19:47:46 +01:00
Niklas Keller
3f08f615d8 Fix segfault with ev on shutdown, fixes amphp/parallel#3 2017-12-19 18:27:18 +01:00
Aaron Piotrowski
be3ae73a45
Drop multiple definitions of Deferred and Emitter
Closes #144, #157, #173, #189, #190.
2017-12-16 00:00:56 -06:00
Niklas Keller
0cb033084a Fix formatStacktrace notice 2017-12-07 18:23:19 +01:00
Niklas Keller
98cfaa63ca Remove unused variables 2017-12-05 08:48:56 +01:00
Aaron Piotrowski
4ef9af6dff
Check against "false" 2017-12-02 11:15:06 -06:00
Aaron Piotrowski
e3b0b9a0c7
Update backtrace formatting 2017-12-02 11:14:49 -06:00
Aaron Piotrowski
745a95ba67
Define AMP_DEBUG through environment 2017-12-02 10:23:12 -06:00
Markus Staab
34bf671f13 Automatically add \ for buitins (#186)
Fixes #185.
2017-11-29 13:36:50 +01:00
Bob Weinand
7837d8ce08 Fix #172 - Preserve Promise order within combinator functions 2017-10-10 15:37:31 +02:00
Niklas Keller
df15b07fb3 Replace driver with dummy driver and collect cycles on loop switch
This solves https://github.com/amphp/dns/issues/66. Circular references might otherwise be collected later and __destruct operations using the Loop accessor might cancel watchers on the wrong loop.
2017-10-08 12:52:30 +02:00
Niklas Keller
a247757535 Ignore only warnings for interrupted syscalls in NativeDriver
Fixes #160.
2017-09-19 18:53:39 +02:00
Niklas Keller
7a04dc5c21 Fix EventDriver warnings and bugs
Fixes #163, #159.
2017-09-17 12:18:04 +02:00
Aaron Piotrowski
05491a57c9
Optimize fast-finishing/failing coroutines 2017-08-04 22:50:19 -05:00
Niklas Keller
8f5fb52525 Shut up php-cs-fixer
See https://github.com/FriendsOfPHP/PHP-CS-Fixer/issues/2948.
2017-07-29 23:43:24 +02:00
Bob Weinand
5e93318d85 Fix issue with the loop not terminating with only unreferenced watchers 2017-07-09 09:28:32 +02:00
Aaron Piotrowski
5f3e21a4a4 Add TimeoutCancellationToken 2017-06-13 12:41:47 -05:00
Niklas Keller
c7fcbd96dc Make NullCancellationToken final 2017-06-09 17:22:21 +02:00
Aaron Piotrowski
9757b39fab Use call in LazyPromise and make class final 2017-06-09 10:18:06 -05:00
Aaron Piotrowski
f83d36dfe5 Update promise docblocks 2017-06-06 12:57:03 -05:00
Aaron Piotrowski
7a05fe1316 Use static function for rethrow 2017-06-05 00:21:45 -05:00
Aaron Piotrowski
6ec8757698 Use references instead of function invocation 2017-06-05 00:19:34 -05:00
Aaron Piotrowski
b354b04779 Fix code style 2017-06-05 00:10:13 -05:00
Aaron Piotrowski
02eb0340f1 Use anonymous classes in Deferred and Emitter 2017-06-04 23:59:23 -05:00