mirror of
https://github.com/danog/parallel.git
synced 2024-12-12 09:09:35 +01:00
28 lines
467 B
PHP
28 lines
467 B
PHP
<?php
|
|
|
|
namespace Amp\Parallel;
|
|
|
|
use Interop\Async\Promise;
|
|
|
|
interface Context {
|
|
/**
|
|
* @return bool
|
|
*/
|
|
public function isRunning(): bool;
|
|
|
|
/**
|
|
* Starts the execution context.
|
|
*/
|
|
public function start();
|
|
|
|
/**
|
|
* Immediately kills the context.
|
|
*/
|
|
public function kill();
|
|
|
|
/**
|
|
* @return \Interop\Async\Promise<mixed> Resolves with the returned from the context.
|
|
*/
|
|
public function join(): Promise;
|
|
}
|