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

19 lines
327 B
PHP
Raw Normal View History

<?php
namespace Icicle\Concurrent\Worker;
class WorkerFactory
{
public function create()
{
2015-08-27 09:10:08 -05:00
if (extension_loaded('pthreads')) {
return new WorkerThread();
}
if (extension_loaded('pcntl')) {
return new WorkerFork();
}
return new WorkerProcess();
}
}