2016-08-21 23:40:48 -05:00
|
|
|
<?php declare(strict_types = 1);
|
2016-08-18 11:04:48 -05:00
|
|
|
|
|
|
|
namespace Amp\Concurrent\Worker;
|
2015-08-14 12:25:07 -05:00
|
|
|
|
2015-08-27 22:51:50 -05:00
|
|
|
/**
|
2015-12-04 23:50:32 -06:00
|
|
|
* Interface for factories used to create new workers.
|
2015-08-27 22:51:50 -05:00
|
|
|
*/
|
2016-08-18 11:04:48 -05:00
|
|
|
interface WorkerFactory {
|
2015-08-27 22:51:50 -05:00
|
|
|
/**
|
2015-12-04 23:50:32 -06:00
|
|
|
* Creates a new worker instance.
|
2015-08-27 22:51:50 -05:00
|
|
|
*
|
2015-12-04 23:50:32 -06:00
|
|
|
* @return Worker The newly created worker.
|
2015-08-27 22:51:50 -05:00
|
|
|
*/
|
2016-01-23 00:00:56 -06:00
|
|
|
public function create(): Worker;
|
2015-08-14 12:25:07 -05:00
|
|
|
}
|