1
0
mirror of https://github.com/danog/file.git synced 2024-11-30 04:19:39 +01:00

Update to amphp/parallel v1.0

This commit is contained in:
Aaron Piotrowski 2018-10-27 10:21:18 -05:00
parent cc1d11993e
commit 836e0ebb03
No known key found for this signature in database
GPG Key ID: ADD1EF783EDE9EEB
2 changed files with 2 additions and 2 deletions

View File

@ -34,7 +34,7 @@
"require": { "require": {
"amphp/amp": "^2", "amphp/amp": "^2",
"amphp/byte-stream": "^1", "amphp/byte-stream": "^1",
"amphp/parallel": "^0.2" "amphp/parallel": "^1"
}, },
"require-dev": { "require-dev": {
"amphp/phpunit-util": "^1", "amphp/phpunit-util": "^1",

View File

@ -29,7 +29,7 @@ class ParallelDriver implements Driver {
*/ */
public function open(string $path, string $mode): Promise { public function open(string $path, string $mode): Promise {
return call(function () use ($path, $mode) { return call(function () use ($path, $mode) {
$worker = $this->pool->get(); $worker = $this->pool->getWorker();
try { try {
list($id, $size, $mode) = yield $worker->enqueue(new Internal\FileTask("fopen", [$path, $mode])); list($id, $size, $mode) = yield $worker->enqueue(new Internal\FileTask("fopen", [$path, $mode]));
} catch (TaskException $exception) { } catch (TaskException $exception) {