Commit Graph

65 Commits

Author SHA1 Message Date
Aaron Piotrowski
7f8ca5472d Add DelegatingWorkerPool
Some checks are pending
Continuous Integration / PHP ${{ matrix.php-version }} ${{ matrix.job-description }} (false, on Windows, windows-latest, nts, 8.3) (push) Waiting to run
Continuous Integration / PHP ${{ matrix.php-version }} ${{ matrix.job-description }} (false, on macOS, macos-latest, nts, 8.3) (push) Waiting to run
Continuous Integration / PHP ${{ matrix.php-version }} ${{ matrix.job-description }} (false, ubuntu-latest, nts, 8.1) (push) Waiting to run
Continuous Integration / PHP ${{ matrix.php-version }} ${{ matrix.job-description }} (false, ubuntu-latest, nts, 8.2) (push) Waiting to run
Continuous Integration / PHP ${{ matrix.php-version }} ${{ matrix.job-description }} (false, ubuntu-latest, nts, 8.3) (push) Waiting to run
Continuous Integration / PHP ${{ matrix.php-version }} ${{ matrix.job-description }} (none, true, with ext-parallel, ubuntu-latest, parallel, ts, 8.2, none, none) (push) Waiting to run
Continuous Integration / PHP ${{ matrix.php-version }} ${{ matrix.job-description }} (none, true, with ext-parallel, ubuntu-latest, parallel, ts, 8.3, none, none) (push) Waiting to run
2024-09-01 09:40:09 -05:00
Aaron Piotrowski
0dfd136a17 Increase timeout before cancellation
Avoids race condition with parent cancellation check not submitting task to worker.
2024-01-28 12:37:41 -06:00
Aaron Piotrowski
e705d00643 Do not submit cancelled tasks
Fixes #198.
2024-01-28 12:37:41 -06:00
Aaron Piotrowski
470293d4b4 Adjust some tests for Windows CI 2023-12-27 12:24:54 -06:00
Aaron Piotrowski
1988e109ab Fix awaiting worker creation 2023-05-21 21:46:59 -05:00
Aaron Piotrowski
a4edad0d08 Add await() shortcut to Execution
Renamed getResult() to getFuture()
2023-02-14 21:30:55 -06:00
Niklas Keller
abf5fe195b Rename DefaultWorker* to ContextWorker* 2023-02-14 21:31:30 +01:00
Aaron Piotrowski
b19d87fc50 Remove cache from Task::run() 2023-02-06 17:41:20 -06:00
Aaron Piotrowski
bedca5d7af Switch Cache to AtomicCache in Task::run() 2023-02-04 10:07:27 -06:00
Aaron Piotrowski
1905ce8dbe Remove Cache class type from worker factory 2023-02-04 09:30:33 -06:00
Aaron Piotrowski
12b2ea3de1 Forward Xdebug settings to child process 2023-01-01 15:12:34 -06:00
Aaron Piotrowski
35204df750 Improve handling of exceptions thrown in child contexts 2022-12-31 15:45:42 -06:00
Aaron Piotrowski
9e5eec211a Declare strict types 2022-12-17 15:49:26 -06:00
Aaron Piotrowski
c3bb2452c2 Add a couple tests 2022-08-07 12:01:21 -05:00
Niklas Keller
c40cd9735f Replace all with await 2022-07-12 22:41:33 +02:00
Niklas Keller
a583a90eaa Increase timings for macOS 2022-02-06 23:50:53 +01:00
Niklas Keller
9a67f8f272 Improve parameter order in DefaultWorkerFactory 2022-02-06 22:58:34 +01:00
Niklas Keller
5348d43129 Rename Job → Execution, enqueue → submit 2022-02-06 22:31:15 +01:00
Aaron Piotrowski
0c9fdff967 Initial WIP 2022-02-06 00:30:41 -06:00
Aaron Piotrowski
53e59efd1d Use ContextFactory in DefaultWorkerFactory
Eliminates WorkerProcess and WorkerParallel static constructor classes.
2021-12-26 00:45:30 -06:00
Aaron Piotrowski
b318b3eb82 Move ExitResult classes into inter 2021-12-22 16:59:30 -06:00
Aaron Piotrowski
a45aa6370d Refactor worker tasks to have a communication channel 2021-12-20 17:24:13 -06:00
Aaron Piotrowski
13c85413fe Remove Environment
Cache can do the same job now.
2021-12-18 00:27:37 -06:00
Aaron Piotrowski
e2b444a004 Rename enqueue to execute and remove enqueueCallable 2021-12-17 23:55:25 -06:00
Bob Weinand
b7b70d205a Update for recent renames 2021-12-04 16:36:25 +01:00
Aaron Piotrowski
2466d78fd6 Update for rename of coroutine to launch 2021-11-20 15:07:13 -06:00
Aaron Piotrowski
3602a615ce Update for Amp and Revolt changes 2021-10-15 16:49:03 -05:00
Aaron Piotrowski
e47e788e17 Update for Revolt changes and Futures 2021-09-17 14:50:57 -05:00
Niklas Keller
477025c44d Use revolt 2021-03-27 08:05:02 +01:00
Aaron Piotrowski
ae9feed176 Remove Generator to coroutine support for Task::run() 2020-11-15 23:08:15 -06:00
Aaron Piotrowski
59a8822403 Refactor for Amp v3 2020-10-07 23:04:29 -05:00
Aaron Piotrowski
e759ef0c76 Async task resolution 2020-10-07 12:11:25 -05:00
Aaron Piotrowski
131c11e173 Add support for cancelling tasks 2020-10-07 12:11:25 -05:00
Aaron Piotrowski
7f00b8effb Use new amphp/serialization library 2020-04-02 23:26:16 -05:00
Aaron Piotrowski
d378e7bf78 Update expected exception messages 2020-03-06 09:44:37 -06:00
Aaron Piotrowski
53a97cbd92 Expand context & task exceptions 2020-02-14 12:55:38 -06:00
Aaron Piotrowski
09ab72333b Increase test timeout
Parallel threads only check for kills every 250 ms, so this can fail.
2020-02-10 17:40:52 -06:00
Aaron Piotrowski
24213ee911 Upgrade to PHPUnit 7 or 8 2019-08-27 12:17:41 -05:00
Aaron Piotrowski
7c8f936618 Autoloading → Bootstrap
Calling the file a boostrap makes more sense as more than defining an autoloader can be done in the file.
2019-02-22 16:10:30 -06:00
Aaron Piotrowski
7c8756c3a5 Add custom autoloader option for workers
Fixes #55 and #71.
2019-02-20 17:39:39 -06:00
Aaron Piotrowski
9b17d540a9 Move ConstantTask to Fixtures directory 2019-02-13 14:17:52 -06:00
Aaron Piotrowski
9236ade19f Capture previous exceptions of exceptions thrown from Task::run() 2019-01-25 14:29:32 -06:00
Aaron Piotrowski
14def89bff Improve error messages when unserializable data is used 2018-10-23 22:10:12 -05:00
Aaron Piotrowski
562ae6f68d Remove AbstractWorker::cancel() and report worker as running on start 2018-10-08 12:27:18 -05:00
peter279k
4b438814f3 Enhance worker tests (#43) 2018-10-07 10:15:50 -05:00
Aaron Piotrowski
b654463339 Fix code style 2018-10-07 09:50:45 -05:00
Aaron Piotrowski
ca051a0aa6 Fail queued tasks after shutdown is invoked 2018-10-07 09:23:42 -05:00
Aaron Piotrowski
f4411805d6 Fail task with SerializationException; cancel worker if sending otherwise fails 2017-12-13 20:56:28 -06:00
Aaron Piotrowski
9e7d1e0801 Throw if sending task fails 2017-12-13 16:29:44 -06:00
Aaron Piotrowski
312aecf1ff Remove Worker::start()
The context can automatically be started when a job is enqueued.
2017-12-13 14:14:31 -06:00