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