1
0
mirror of https://github.com/danog/amp.git synced 2024-12-12 09:29:45 +01:00
Commit Graph

160 Commits

Author SHA1 Message Date
Aaron Piotrowski
4290bd7e28
Update to simpler ext-fiber API 2021-02-11 23:02:31 -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
b95048abd9
Avoid unnecessary promise object 2020-11-29 22:35:26 -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
a2a78939b9
Use Traversable as return type
Reduces the likelihood of using next()/current() concurrently.
2020-11-10 21:56:00 -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
5d026083df
Update for removal of Awaitable in ext-fiber 2020-11-03 11:18:35 -06:00
Aaron Piotrowski
0838d483fe
Rethrow in loop from any Awaitable failure 2020-11-01 11:19:17 -06:00
Aaron Piotrowski
7669f89b51
Minor optimization for async() 2020-10-30 10:41:38 -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
80ecfe6b99
Promisify signals 2020-10-10 09:06:49 -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
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
4af828f30d
Merge branch update-tests into v3 2020-10-02 13:59:54 -05:00
Aaron Piotrowski
d62ba46fb4
Fix pipeline functions 2020-10-02 13:55:58 -05:00
Niklas Keller
3219618fd8 Add deprecations 2020-09-29 21:25:42 +02:00
Aaron Piotrowski
32c2cd6d64
Drop Loop::run() and Loop::stop()
This is a *huge* shift, but there’s no reason for these to exist in a world with top-level await.
2020-09-27 09:38:52 -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
8e4cc1bbd1
Refactor Pipeline for async/await 2020-09-24 22:14:58 -05:00
Aaron Piotrowski
5f6db028ab
Initial fiber support 2020-09-24 12:53:32 -05:00
Aaron Piotrowski
5e521daa16
Rename to Pipeline 2020-09-24 12:53:31 -05:00
Aaron Piotrowski
217c31c5ce
Add Promise\succeed() and Promise\fail() 2020-09-24 12:53:31 -05:00
Aaron Piotrowski
f4cc591988
Feedback update 2020-09-24 12:53:30 -05:00
Aaron Piotrowski
b64b3affc9
Rename yield() to emit() 2020-09-24 12:53:30 -05:00
Aaron Piotrowski
66f0deb563
Drop YieldedValue 2020-09-24 12:53:29 -05:00
Aaron Piotrowski
d496c9db24
Resolve promise with YieldedValue
A suggested alternative to resolving with [$yieldedValue] since static analysis (specifically Psalm) doesn't play well with that API.

Will revert if Psalm changes or we decide to resolve with [$yieldedValue] anyway.
2020-09-24 12:53:29 -05:00
Aaron Piotrowski
57924690fe
Remove key 2020-09-24 12:53:29 -05:00
Aaron Piotrowski
96007f11aa
Add Streams 2020-09-24 12:53:27 -05:00
Niklas Keller
e2c63c83eb
Add Amp\Iterator\discard (#315) 2020-05-06 18:57:29 +02:00
Niklas Keller
17e2c2344c Improve call / coroutine / wait types, add psalm test 2020-04-30 06:46:52 +02:00
Niklas Keller
a702c85f2f Add generics for Amp\Promise\wait 2020-04-28 22:35:20 +02:00
Niklas Keller
8ee469be90 Improve type definition for Amp\call 2020-04-19 15:38:36 +02: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
b6f99cd534 Use conditional psalm types for improved type inference 2020-04-05 22:17:32 +02:00
Niklas Keller
caea418fe8 Increase psalm error level to level 2 2020-03-28 22:20:44 +01:00
Niklas Keller
f8efd44684 Add additional types for static analysis 2020-03-28 14:20:27 +01:00