mirror of
https://github.com/danog/file.git
synced 2024-11-26 11:54:54 +01:00
Update to amphp/parallel v1.0
This commit is contained in:
parent
cc1d11993e
commit
836e0ebb03
@ -34,7 +34,7 @@
|
||||
"require": {
|
||||
"amphp/amp": "^2",
|
||||
"amphp/byte-stream": "^1",
|
||||
"amphp/parallel": "^0.2"
|
||||
"amphp/parallel": "^1"
|
||||
},
|
||||
"require-dev": {
|
||||
"amphp/phpunit-util": "^1",
|
||||
|
@ -29,7 +29,7 @@ class ParallelDriver implements Driver {
|
||||
*/
|
||||
public function open(string $path, string $mode): Promise {
|
||||
return call(function () use ($path, $mode) {
|
||||
$worker = $this->pool->get();
|
||||
$worker = $this->pool->getWorker();
|
||||
try {
|
||||
list($id, $size, $mode) = yield $worker->enqueue(new Internal\FileTask("fopen", [$path, $mode]));
|
||||
} catch (TaskException $exception) {
|
||||
|
Loading…
Reference in New Issue
Block a user