Eugene Leonovich
e2d9ebefb0
Fix TypeError in EventDriver ( #339 )
2021-01-09 22:24:36 -06:00
Aaron Piotrowski
f02dbc8585
Update for FiberScheduler changes
2021-01-04 13:57:33 -06:00
Aaron Piotrowski
ae93b4cf21
Rename Signal to SignalTrap
...
Also renamed Amp\signal() to trap(), a nice analog to bash’s trap.
2020-12-27 16:31:45 -06:00
Aaron Piotrowski
80ea42bdcf
Update for Fiber constructor change
2020-12-15 22:17:49 -06:00
Aaron Piotrowski
7c7e0ea554
Rename Loop::get() to Loop::getDriver()
...
Also Loop::set() to Loop::setDriver().
2020-12-12 12:15:18 -06:00
Aaron Piotrowski
ee8343e566
Update for ext-fiber suspend API change
2020-12-09 11:22:47 -06:00
Aaron Piotrowski
0f2cf56142
Missed a static
...
Not really necessary here, but we use it everywhere else.
2020-11-29 22:38:58 -06:00
Aaron Piotrowski
8865458454
throw is now an expression!
2020-11-29 22:36:55 -06:00
Aaron Piotrowski
b95048abd9
Avoid unnecessary promise object
2020-11-29 22:35:26 -06:00
Aaron Piotrowski
74a24b36df
Rearrange EmitSouce::push()
2020-11-29 00:04:42 -06:00
Aaron Piotrowski
0c031e7c90
Reduce nesting
2020-11-28 23:31:27 -06:00
Aaron Piotrowski
051320a30f
Update for ext-fiber changes
2020-11-21 00:18:14 -06:00
Aaron Piotrowski
73bf4c35b9
Minor optimization to consuming values
2020-11-18 12:35:52 -06:00
Aaron Piotrowski
f7f37aa86e
Avoid creating unnecessary promise objects
...
If backpressure is always awaited, this avoids creating promises.
2020-11-17 17:28:28 -06:00
Aaron Piotrowski
014adbd89e
Fix emit after disposal
2020-11-16 17:20:13 -06:00
Aaron Piotrowski
31adf876b6
Merge branch 'master' into v3
...
# Conflicts:
# lib/Loop/Internal/TimerQueue.php
# lib/Loop/Internal/TimerQueueEntry.php
2020-11-14 10:52:36 -06:00
Aaron Piotrowski
dbb3c28ece
Remove TimerQueueEntry
...
Unnecessary now that Watchers have an expiration property.
2020-11-14 10:44:06 -06:00
Aaron Piotrowski
a2a78939b9
Use Traversable as return type
...
Reduces the likelihood of using next()/current() concurrently.
2020-11-10 21:56:00 -06:00
Aaron Piotrowski
791885592e
Remove unnecessary indirection
...
Also updated some psalm params and returns.
2020-11-10 13:28:43 -06:00
Aaron Piotrowski
fa31b4b3d5
Pipeline extends Traversable
...
Allows pipelines to be used directly with foreach.
2020-11-10 12:05:47 -06:00
Aaron Piotrowski
6d5e0f5ff7
More direct use of fiber
...
Avoids creating unnecessary promise objects.
delay(0) ticking the loop only once required using delay(x) instead of delay(0) in some tests.
2020-11-05 23:55:06 -06:00
Aaron Piotrowski
f3b189f33f
Update for Continuation
2020-11-05 11:29:31 -06:00
Aaron Piotrowski
cff6bba499
Missed an Awaitable usage
2020-11-05 10:16:42 -06:00
Aaron Piotrowski
8d8358023f
Merge branch 'master' into v3
2020-11-03 17:29:41 -06:00
Aaron Piotrowski
ae42c11053
Allow failing pipeline with DisposedException
2020-11-03 17:02:56 -06:00
Aaron Piotrowski
865238bc16
Use fiber directly when emitting values
2020-11-03 16:55:29 -06:00
Aaron Piotrowski
5d026083df
Update for removal of Awaitable in ext-fiber
2020-11-03 11:18:35 -06:00
descawed
ecdc3c476b
Correct heap implementation in TimerQueue ( #332 )
...
* Correct heap implementation in TimerQueue, which would sometimes extract timers in the wrong order after a node other than the root was removed
* Factor out old heap rebuilding code into its own method to satisfy codeclimate requirements
2020-11-03 10:23:45 -06:00
Aaron Piotrowski
0838d483fe
Rethrow in loop from any Awaitable failure
2020-11-01 11:19:17 -06:00
Aaron Piotrowski
3ebd44ee09
defer instead of Loop::defer
...
Callbacks should be run in a fiber in case they await.
2020-11-01 11:14:03 -06:00
Aaron Piotrowski
eaa7c45049
Make Driver an interface
2020-11-01 09:43:21 -06:00
Aaron Piotrowski
7669f89b51
Minor optimization for async()
2020-10-30 10:41:38 -05: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
Niklas Keller
fc423c7db5
Remove static to access $this
2020-10-25 21:44:01 +01:00
Aaron Piotrowski
eec21c12c6
Fix use before init
2020-10-22 23:03:58 -05:00
Aaron Piotrowski
80ecfe6b99
Promisify signals
2020-10-10 09:06:49 -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
cecbbd3f40
Drop sleep() and refactor delay to use await()
2020-10-06 23:40:14 -05:00
Aaron Piotrowski
1b30909215
Remove succeed() and fail()
2020-10-04 10:22:51 -05:00
Aaron Piotrowski
40aab8eef5
Add defer()
2020-10-04 10:22:21 -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
822995a69b
Remove InvalidYieldError
...
Unused.
2020-10-02 22:49:41 -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
7a6fa6fd34
Simplify AsyncGenerator too
2020-10-02 14:14:30 -05:00
Aaron Piotrowski
4af828f30d
Merge branch update-tests into v3
2020-10-02 13:59:54 -05:00