Skip to content

Commit

Permalink
Merge 2ab844b into ac8eed8
Browse files Browse the repository at this point in the history
  • Loading branch information
rjkip committed Nov 22, 2014
2 parents ac8eed8 + 2ab844b commit 5099369
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/Kernel/Api/KernelApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,8 @@ public function execute(StrandInterface $strand, $coroutine)
/**
* Wait for one or more of the given strands to exit.
*
* @param StrandInterface $strand The currently executing strand.
* @param array<StrandInterface> $strands The strands to wait for.
* @param StrandInterface $strand The currently executing strand.
* @param StrandInterface[] $strands The strands to wait for.
*/
public function select(StrandInterface $strand, array $strands)
{
Expand Down
4 changes: 2 additions & 2 deletions src/Kernel/Api/KernelApiInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ public function execute(StrandInterface $strand, $coroutine);
/**
* Wait for one or more of the given strands to exit.
*
* @param StrandInterface $strand The currently executing strand.
* @param array<StrandInterface> $strands The strands to wait for.
* @param StrandInterface $strand The currently executing strand.
* @param StrandInterface[] $strands The strands to wait for.
*/
public function select(StrandInterface $strand, array $strands);

Expand Down
1 change: 1 addition & 0 deletions src/Kernel/Strand/StrandInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
use Evenement\EventEmitterInterface;
use Exception;
use Recoil\Coroutine\CoroutineInterface;
use Recoil\Kernel\KernelInterface;

/**
* A strand represents a user-space "thread" of execution.
Expand Down
21 changes: 19 additions & 2 deletions src/Recoil.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
use Recoil\Kernel\Api\KernelApiCall;
use Recoil\Kernel\Kernel;
use React\EventLoop\LoopInterface;
use Recoil\Kernel\Strand\StrandInterface;

/**
* Public facade for Kernel API calls.
Expand All @@ -14,6 +15,22 @@
*
* The interface {@link Recoil\Kernel\KernelApiInterface} defines the
* operations that are available; some kernels may provide additional features.
*
* @method strand() [COROUTINE] Get the strand the coroutine is executing on.
* @method kernel() [COROUTINE] Get the coroutine kernel that the current strand is executing on.
* @method eventLoop() [COROUTINE] Get the React event-loop that the coroutine kernel is executing on.
* @method return_($value) [COROUTINE] Return a value to the calling coroutine.
* @method throw_(Exception $exception) [COROUTINE] Throw an exception to the calling coroutine.
* @method finally_(callable $callback) [COROUTINE] Register a callback to be invoked when the current coroutine ends.
* @method terminate() [COROUTINE] Terminate execution of this strand.
* @method sleep(float $timeout) [COROUTINE] Suspend execution for a specified period of time.
* @method suspend(callable $callback) [COROUTINE] Suspend execution of the strand until it is resumed manually.
* @method timeout(float $timeout, $coroutine) [COROUTINE] Execute a coroutine with a time limit.
* @method all(array $coroutines) [COROUTINE] Execute the given coroutines concurrently.
* @method noop() [COROUTINE] Resume the strand immediately.
* @method cooperate() [COROUTINE] Suspend the strand until the next tick.
* @method execute($coroutine) [COROUTINE] Execute a coroutine on its own strand.
* @method stop(bool $stopEventLoop = true) [COROUTINE] Stop the coroutine kernel / event-loop.
*/
abstract class Recoil
{
Expand All @@ -37,8 +54,8 @@ public static function __callStatic($name, array $arguments)
* This is convenience method used to start the coroutine engine.
* It should generally not be invoked from inside other coroutines.
*
* @param callable $entryPoint The coroutine to invoke.
* @param LoopInterface|null $loopInterface The React event-loop, or null to use the default.
* @param callable $entryPoint The coroutine to invoke.
* @param LoopInterface|null $eventLoop The React event-loop, or null to use the default.
*/
public static function run(callable $entryPoint, LoopInterface $eventLoop = null)
{
Expand Down

0 comments on commit 5099369

Please sign in to comment.