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