2015-08-27 16:10:08 +02:00
|
|
|
<?php
|
|
|
|
|
2016-08-18 18:04:48 +02:00
|
|
|
namespace Amp\Concurrent;
|
|
|
|
|
|
|
|
use Interop\Async\Awaitable;
|
|
|
|
|
|
|
|
interface Context {
|
2015-08-27 16:10:08 +02:00
|
|
|
/**
|
|
|
|
* @return bool
|
|
|
|
*/
|
2016-01-23 07:00:56 +01:00
|
|
|
public function isRunning(): bool;
|
2015-08-27 16:10:08 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Starts the execution context.
|
|
|
|
*/
|
|
|
|
public function start();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Immediately kills the context.
|
|
|
|
*/
|
|
|
|
public function kill();
|
|
|
|
|
|
|
|
/**
|
2016-08-18 18:04:48 +02:00
|
|
|
* @return \Interop\Async\Awaitable<mixed> Resolves with the returned from the context.
|
2015-08-27 16:10:08 +02:00
|
|
|
*/
|
2016-08-18 18:04:48 +02:00
|
|
|
public function join(): Awaitable;
|
2015-08-27 20:06:39 +02:00
|
|
|
}
|