1
0
mirror of https://github.com/danog/parallel.git synced 2024-12-03 10:07:49 +01:00
parallel/lib/Worker/Task.php
2016-07-20 09:23:50 -05:00

24 lines
497 B
PHP

<?php
namespace Icicle\Concurrent\Worker;
/**
* A runnable unit of execution.
*/
interface Task
{
/**
* @coroutine
*
* Runs the task inside the caller's context.
*
* Does not have to be a coroutine, can also be a regular function returning a value.
*
* @param \Icicle\Concurrent\Worker\Environment
*
* @return mixed|\Icicle\Awaitable\Awaitable|\Generator
*
* @resolve mixed
*/
public function run(Environment $environment);
}