1
0
mirror of https://github.com/danog/parallel.git synced 2025-01-06 04:38:21 +01:00
parallel/src/Worker/Task.php
2015-12-04 23:50:32 -06:00

24 lines
463 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 \Generator
*
* @resolve mixed
*/
public function run(Environment $environment);
}