1
0
mirror of https://github.com/danog/parallel.git synced 2024-12-03 10:07:49 +01:00
parallel/src/Worker/Task.php

24 lines
475 B
PHP
Raw Normal View History

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