1
0
mirror of https://github.com/danog/amp.git synced 2024-12-02 17:37:50 +01:00
Commit Graph

360 Commits

Author SHA1 Message Date
Aaron Piotrowski
ca122a9035
Update for Revolt changes 2021-09-19 10:20:04 -05:00
Aaron Piotrowski
24a1dce81c
Rename Future::join() to await() 2021-09-18 23:05:16 -05:00
Aaron Piotrowski
c98c9a40d2
Rename Amp\Future\spawn() to Amp\coroutine()
Added delay() and trap() functions.
2021-09-18 23:04:20 -05:00
Aaron Piotrowski
a35a6da724
Rename first() to race()
Mirrors name in JS.
2021-09-16 21:01:18 -05:00
Aaron Piotrowski
a7f31d1b98
Fix future completing then cancelling join
If both callbacks are enqueued they may be both invoked, so only throw to the suspension if the promise isn't resolved.
2021-09-16 20:54:19 -05:00
Aaron Piotrowski
e0fe64c495
Add settle() 2021-09-16 20:49:55 -05:00
Aaron Piotrowski
81b9c749a7
Add some() 2021-09-16 20:49:42 -05:00
Aaron Piotrowski
bfe8d635b8
Export Pipeline to separate repo 2021-09-05 23:47:06 -05:00
Aaron Piotrowski
b757b74c62
Test merge disposal; provide exception to dispose callbacks
Plus some doc updates.
2021-09-04 09:58:01 -05:00
Aaron Piotrowski
73fb73614e
Reduce overhead for timeout cancellation tokens 2021-08-30 12:07:07 -05:00
Aaron Piotrowski
eab76ca303
Cancellable joins 2021-08-29 23:28:25 -05:00
Aaron Piotrowski
5b95aa590c
Update for Revolt changes and Future import 2021-08-29 12:18:24 -05:00
Aaron Piotrowski
7e30ee0c2c
Import Future
Co-authored-by: Niklas Keller <me@kelunik.com>
2021-08-29 12:18:05 -05:00
Aaron Piotrowski
10817e8522
Rename fail() to error()
Matches Future methods.
2021-04-04 13:31:08 -05:00
Aaron Piotrowski
8043c1e92b
Never throw from AsyncGenerator constructor 2021-04-04 13:29:15 -05:00
Aaron Piotrowski
820bbd2058
Use Revolt Futures, drop Promises 2021-04-04 13:10:23 -05:00
Aaron Piotrowski
d2a5f7e9df
Use Suspension instead of promises in EmitSource 2021-03-28 12:39:11 -05:00
Niklas Keller
2f778fe069 Use revolt
Removes deprecated APIs.
2021-03-26 22:34:32 +01:00
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
7c7e0ea554
Rename Loop::get() to Loop::getDriver()
Also Loop::set() to Loop::setDriver().
2020-12-12 12:15:18 -06:00
Aaron Piotrowski
8865458454
throw is now an expression! 2020-11-29 22:36:55 -06:00
Aaron Piotrowski
a673c80fde
Fix active watchers in some tests 2020-11-21 00:18:36 -06:00
Aaron Piotrowski
014adbd89e
Fix emit after disposal 2020-11-16 17:20:13 -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
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
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
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
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
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
3dbebd2a77
Remove unused BaseTest 2020-10-04 10:12:22 -05:00
Aaron Piotrowski
b226030a11
Remove tests incompatible with ext-fiber 2020-10-03 21:57:35 -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
825efaf841
Fix test 2020-10-02 22:42:52 -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
27a8facd6a
Update tests for fibers 2020-10-02 13:40:29 -05:00
Aaron Piotrowski
7e03928faf
Drop CallableMaker 2020-09-26 22:31:08 -05:00
Aaron Piotrowski
07a9965ba6
Run promisor in LazyPromise in new fiber 2020-09-26 22:26:57 -05:00