1
0
mirror of https://github.com/danog/parallel.git synced 2024-12-12 09:09:35 +01:00
parallel/lib/Worker/Task.php
Aaron Piotrowski da84a772cf Port to Amp
2016-08-18 11:04:48 -05:00

20 lines
435 B
PHP

<?php
namespace Amp\Concurrent\Worker;
/**
* A runnable unit of execution.
*/
interface Task {
/**
* 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 \Amp\Concurrent\Worker\Environment
*
* @return mixed|\Interop\Async\Awaitable|\Generator
*/
public function run(Environment $environment);
}