mirror of
https://github.com/danog/parallel.git
synced 2024-12-04 18:47:50 +01:00
31 lines
637 B
PHP
31 lines
637 B
PHP
<?php
|
|
|
|
namespace Amp\Parallel;
|
|
|
|
use AsyncInterop\Promise;
|
|
|
|
interface Context {
|
|
/**
|
|
* @return bool
|
|
*/
|
|
public function isRunning(): bool;
|
|
|
|
/**
|
|
* Starts the execution context.
|
|
*/
|
|
public function start();
|
|
|
|
/**
|
|
* Immediately kills the context.
|
|
*/
|
|
public function kill();
|
|
|
|
/**
|
|
* @return \AsyncInterop\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;
|
|
}
|