1
0
mirror of https://github.com/danog/amp.git synced 2024-12-11 08:59:46 +01:00
Commit Graph

107 Commits

Author SHA1 Message Date
Aaron Piotrowski
eaa7c45049
Make Driver an interface 2020-11-01 09:43:21 -06:00
Aaron Piotrowski
6cf7ae13bb
Remove automatic Generator to Coroutine conversion 2020-10-30 10:36:19 -05:00
Aaron Piotrowski
7612ef3f1e
Drop direct conversion of React promises
React promises are still supported using Amp\Promise\adapt().
2020-10-30 10:19:12 -05:00
Aaron Piotrowski
ee3c09087b
Merge branch 'master' into v3 2020-10-10 08:57:34 -05:00
Aaron Piotrowski
eb2f325586
Fix NativeDriver when only signals are enabled 2020-10-10 08:54:50 -05:00
Aaron Piotrowski
1db52920ab
Mark loop classes final 2020-10-09 13:23:33 -05:00
Aaron Piotrowski
8ee7d61452
Remove registry data and error handler when clearing loop 2020-10-07 22:52:23 -05:00
Aaron Piotrowski
249aa95256
Forbid loop nesting 2020-10-03 09:42:29 -05:00
Aaron Piotrowski
45bd189e76
Add Driver::clear()
Intended for tests over swapping the entire event loop.

This allows forbidding swapping the global event loop once it is started.
2020-10-03 08:38:31 -05:00
Aaron Piotrowski
4c8cd6b7b1
Revert DriverControl
Simplifies fiber running the loop. Control complexity seems unnecessary now since the loop should not need to be started by the user.
2020-10-02 22:26:10 -05:00
Aaron Piotrowski
492442db2d
Check run count on dispatch 2020-10-02 13:55:00 -05:00
Aaron Piotrowski
7e03928faf
Drop CallableMaker 2020-09-26 22:31:08 -05:00
Aaron Piotrowski
9f68bd4046
Remove Driver::run() and stop()
Added Driver::isRunning().

Driver now must be started and stopped through an instance of DriverControl.
2020-09-26 12:50:30 -05:00
Aaron Piotrowski
9a2ebe777a
Merge branch 'kelunik-nested-wait' into v3 2020-09-26 11:40:38 -05:00
Aaron Piotrowski
d48e6bd5d2
Add more class and return types
More PHP 7.1 to 8 types added.
2020-09-24 22:17:13 -05:00
Aaron Piotrowski
5f6db028ab
Initial fiber support 2020-09-24 12:53:32 -05:00
Niklas Keller
05483cdbef
Enforce timer interval as minimum time to execution (#319)
Co-authored-by: Aaron Piotrowski <aaron@trowski.com>
2020-07-14 21:45:35 +02:00
Aaron Piotrowski
0b802a501e
Mark repeat watcher as disabled then re-enable when executed (#325)
Fixes #324.
2020-07-13 22:29:16 +02:00
Aaron Piotrowski
a04eda397b
Fix potential warning on shutdown in UvDriver
Like everything shutdown related, this depends on destruction order and appears to only happen on 7.4+.
2020-07-13 10:12:25 -05:00
Niklas Keller
8ee469be90 Improve type definition for Amp\call 2020-04-19 15:38:36 +02:00
Aaron Piotrowski
0eb8ef438e
Make DriverControl an interface 2020-04-16 11:08:31 -05:00
Aaron Piotrowski
ab409bb254
Rename to DriverControl 2020-04-16 10:59:02 -05:00
Aaron Piotrowski
702aee45d3
Use delegate loop for Promise\wait() 2020-04-16 10:17:37 -05:00
Aaron Piotrowski
a062c3ed26
Update docs 2020-04-16 10:01:53 -05:00
Niklas Keller
5b4d019753 Allow tested calls to Amp\Promise\wait 2020-04-15 22:47:43 +02:00
Niklas Keller
c34b679142 Remove psalm-suppress for fixed psalm bugs 2020-03-29 14:24:09 +02:00
Niklas Keller
caea418fe8 Increase psalm error level to level 2 2020-03-28 22:20:44 +01:00
Niklas Keller
885cd68828 Increase psalm error level to level 3 2020-03-28 21:55:44 +01:00
Niklas Keller
0e04422dcb Increase psalm error level to level 4 2020-03-28 20:27:42 +01: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
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
2ac3b550c4
Fix array access on null last error 2020-02-10 12:10:57 -06:00
Aaron Piotrowski
193efe7e96
Return null, not -1 2019-11-11 13:23:14 -06:00
Aaron Piotrowski
dd4d6be677
Remove unneeded method
Fix big-O lies in docblock.
2019-10-31 15:41:07 -05:00
Aaron Piotrowski
710f84ccc8
Improve timer cancellation in NativeDriver 2019-10-30 09:41:46 -05:00
Niklas Keller
64e7d10108 Fix cancellation trace recording in TracingDriver 2019-10-26 16:20:56 +02:00
Niklas Keller
5a294f1381 Fix TracingDriver, add TracingDriverTest 2019-10-01 21:39:23 +02:00
Niklas Keller
1657284608
Add TracingDriver for debugging (#283) 2019-10-01 21:01:44 +02: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
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
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
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