1
0
mirror of https://github.com/danog/parallel.git synced 2024-12-11 16:49:51 +01:00
parallel/lib/Context/Context.php
Aaron Piotrowski 4426686e54
Reorganize
2017-12-07 21:26:55 -06:00

32 lines
687 B
PHP

<?php
namespace Amp\Parallel\Context;
use Amp\Parallel\Sync\Channel;
use Amp\Promise;
interface Context extends Channel {
/**
* @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\Context\ContextException If the context dies unexpectedly.
* @throws \Amp\Parallel\Sync\PanicError If the context throws an uncaught exception.
*/
public function join(): Promise;
}