1
0
mirror of https://github.com/danog/parallel.git synced 2024-11-27 04:44:56 +01:00
parallel/lib/Context.php
2017-03-16 17:03:59 -05:00

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;
}