mirror of
https://github.com/danog/parallel.git
synced 2024-11-26 20:34:40 +01:00
19 lines
404 B
PHP
Executable File
19 lines
404 B
PHP
Executable File
#!/usr/bin/env php
|
|
<?php
|
|
require dirname(__DIR__).'/vendor/autoload.php';
|
|
|
|
use Icicle\Concurrent\Worker\HelloTask;
|
|
use Icicle\Concurrent\Worker\WorkerThread;
|
|
use Icicle\Coroutine;
|
|
use Icicle\Loop;
|
|
|
|
Coroutine\create(function () {
|
|
$worker = new WorkerThread();
|
|
$worker->start();
|
|
|
|
$returnValue = (yield $worker->enqueue(new HelloTask()));
|
|
yield $worker->shutdown();
|
|
})->done();
|
|
|
|
Loop\run();
|