1
0
mirror of https://github.com/danog/parallel.git synced 2025-01-22 05:51:14 +01:00
parallel/src/Worker/Task.php

24 lines
463 B
PHP
Raw Normal View History

<?php
namespace Icicle\Concurrent\Worker;
/**
* A runnable unit of execution.
*/
2015-12-04 23:50:32 -06:00
interface Task
{
/**
2015-08-27 09:10:08 -05:00
* @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.
2015-08-27 09:10:08 -05:00
*
2015-09-09 23:29:41 -05:00
* @param \Icicle\Concurrent\Worker\Environment
*
2015-08-27 09:10:08 -05:00
* @return \Generator
*
* @resolve mixed
*/
2015-09-09 23:29:41 -05:00
public function run(Environment $environment);
}