mirror of
https://github.com/danog/parallel.git
synced 2024-12-03 18:17:52 +01:00
cb5ea736d4
Processes now use a shared server socket instead of stdin and stdout for IPC.
32 lines
696 B
PHP
32 lines
696 B
PHP
<?php
|
|
|
|
namespace Amp\Parallel\Context;
|
|
|
|
use Amp\Parallel\Sync\Channel;
|
|
use Amp\Promise;
|
|
|
|
interface Context extends Channel {
|
|
/**
|
|
* @return bool
|
|
*/
|
|
public function isRunning(): bool;
|
|
|
|
/**
|
|
* Starts the execution context.
|
|
*/
|
|
public function start(): Promise;
|
|
|
|
/**
|
|
* Immediately kills the context.
|
|
*/
|
|
public function kill();
|
|
|
|
/**
|
|
* @return \Amp\Promise<mixed> Resolves with the returned from the context.
|
|
*
|
|
* @throws \Amp\Parallel\Context\ContextException If the context dies unexpectedly.
|
|
* @throws \Amp\Parallel\Sync\PanicError If the context throws an uncaught exception.
|
|
*/
|
|
public function join(): Promise;
|
|
}
|