mirror of
https://github.com/danog/parallel.git
synced 2024-12-03 10:07:49 +01:00
24 lines
497 B
PHP
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);
|
|
}
|