mirror of
https://github.com/amphp/parallel.git
synced 2025-07-25 07:21:52 +02:00
28 lines
475 B
PHP
28 lines
475 B
PHP
<?php
|
|
|
|
namespace Amp\Concurrent;
|
|
|
|
use Interop\Async\Awaitable;
|
|
|
|
interface Context {
|
|
/**
|
|
* @return bool
|
|
*/
|
|
public function isRunning(): bool;
|
|
|
|
/**
|
|
* Starts the execution context.
|
|
*/
|
|
public function start();
|
|
|
|
/**
|
|
* Immediately kills the context.
|
|
*/
|
|
public function kill();
|
|
|
|
/**
|
|
* @return \Interop\Async\Awaitable<mixed> Resolves with the returned from the context.
|
|
*/
|
|
public function join(): Awaitable;
|
|
}
|