mirror of
https://github.com/danog/parallel.git
synced 2024-11-26 20:34:40 +01:00
Continue using pthreads for workers
Will consider removing in the future, but a deprecation period should come before.
This commit is contained in:
parent
f919371aee
commit
a9a5807798
@ -3,6 +3,7 @@
|
||||
namespace Amp\Parallel\Worker;
|
||||
|
||||
use Amp\Parallel\Context\Parallel;
|
||||
use Amp\Parallel\Context\Thread;
|
||||
|
||||
/**
|
||||
* The built-in worker factory type.
|
||||
@ -44,10 +45,12 @@ final class DefaultWorkerFactory implements WorkerFactory
|
||||
public function create(): Worker
|
||||
{
|
||||
if (Parallel::isSupported()) {
|
||||
return new WorkerThread($this->className);
|
||||
return new WorkerParallel($this->className);
|
||||
}
|
||||
|
||||
// Thread context is not use as pthreads is deprecated.
|
||||
if (Thread::isSupported()) {
|
||||
return new WorkerThread($this->className);
|
||||
}
|
||||
|
||||
return new WorkerProcess(
|
||||
$this->className,
|
||||
|
Loading…
Reference in New Issue
Block a user