2016-08-21 23:40:48 -05:00
|
|
|
<?php declare(strict_types = 1);
|
2015-08-27 09:10:08 -05:00
|
|
|
|
2016-08-23 16:47:40 -05:00
|
|
|
namespace Amp\Parallel;
|
2016-08-18 11:04:48 -05:00
|
|
|
|
|
|
|
use Interop\Async\Awaitable;
|
|
|
|
|
|
|
|
interface Context {
|
2015-08-27 09:10:08 -05:00
|
|
|
/**
|
|
|
|
* @return bool
|
|
|
|
*/
|
2016-01-23 00:00:56 -06:00
|
|
|
public function isRunning(): bool;
|
2015-08-27 09:10:08 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Starts the execution context.
|
|
|
|
*/
|
|
|
|
public function start();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Immediately kills the context.
|
|
|
|
*/
|
|
|
|
public function kill();
|
|
|
|
|
|
|
|
/**
|
2016-08-18 11:04:48 -05:00
|
|
|
* @return \Interop\Async\Awaitable<mixed> Resolves with the returned from the context.
|
2015-08-27 09:10:08 -05:00
|
|
|
*/
|
2016-08-18 11:04:48 -05:00
|
|
|
public function join(): Awaitable;
|
2015-08-27 13:06:39 -05:00
|
|
|
}
|