Run PHP workers under Portals.
This package bundles the dependency-free PHP worker SDK and loads it into
the worker with PHP's auto_prepend_file setting, so a worker script can
use Portals\Worker straight away — no require and no Composer
package.
children = [
{Portals.Pool,
Portals.PHP.worker_opts(
script: Application.app_dir(:my_app, "priv/php/worker.php"),
name: MyApp.PHP,
size: 4
)}
]See the PHP guide for a full walkthrough.
Summary
Functions
Build Portals.start_worker/1 / Portals.start_pool/1 options for a PHP
worker script.
Functions
Build Portals.start_worker/1 / Portals.start_pool/1 options for a PHP
worker script.
Options
:script(required) — path to the worker entry script, which calls(new Portals\Worker(...))->run().:php— the CLI binary, as a name looked up onPATHor a path. Defaults to"php".:php_args— interpreter flags placed before the script, e.g.["-d", "memory_limit=512M"].:prepend_sdk— load the SDK throughauto_prepend_file. Defaults totrue. Set it tofalseif yourphp.inialready usesauto_prepend_file, andrequire_oncethe SDK yourself fromgetenv('PORTALS_SDK_PATH') . '/portals.php'.:args— arguments passed to the script. Portals appends the socket path after these, as the last argument.:env— extra{name, value}environment entries; these win over the ones set here.
Every other option is passed through unchanged.