Skip to content

Commit

Permalink
fall back to sync worker on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
matthi4s committed Jan 29, 2024
1 parent d12f73e commit f89230a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ on a webserver.

Tasks can communicate back to the main process during execution and handle results and errors gracefully.

This library is not supported on Windows due to a lack of essential features. The autodetect falls back to the
sync worker on Windows, so running tasks should be possible, but running tasks in parallel does not work.

<!-- TOC -->
* [Installation](#installation)
* [Basic Example](#basic-example)
Expand Down
2 changes: 1 addition & 1 deletion src/Taskmaster.php
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ public function autoDetectWorkers(int $count, bool $loadFromEnv = true, bool $al
if (!$worker) {
if (extension_loaded("pcntl")) {
$worker = new ForkWorker();
} elseif (function_exists("proc_open")) {
} elseif (function_exists("proc_open") && PHP_OS_FAMILY !== "Windows") {
$worker = new ProcessWorker();
} else {
$worker = new SyncWorker();
Expand Down

0 comments on commit f89230a

Please sign in to comment.