1
0
mirror of https://github.com/danog/parallel.git synced 2024-11-27 04:44:56 +01:00
parallel/lib/Context.php
Aaron Piotrowski f48066eb1b
Drop Fork along with Process and Strand interfaces
Forking is just too dangerous for virtually no gain over Process. Context now extends Sync\Channel.
2017-11-10 09:59:23 -06:00

31 lines
640 B
PHP

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