We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4d58c28 commit df4c1f3Copy full SHA for df4c1f3
src/Process/ProcessPromise.php
@@ -24,7 +24,9 @@ final class ProcessPromise
24
25
public function __construct(private LoopInterface $loop, private string $name, private string $command)
26
{
27
- $this->deferred = new Deferred();
+ $this->deferred = new Deferred(function (): void {
28
+ $this->cancel();
29
+ });
30
}
31
32
public function getName(): string
@@ -85,7 +87,7 @@ public function run(): PromiseInterface
85
87
return $this->deferred->promise();
86
88
89
- public function cancel(): void
90
+ private function cancel(): void
91
92
if ($this->process === null) {
93
throw new ShouldNotHappenException('Cancelling process before running');
0 commit comments