Skip to content

Document the worker bootstrap file (ContextWorkerFactory) - #231

Open
AjmalAlkhaledi wants to merge 1 commit into
amphp:2.xfrom
AjmalAlkhaledi:docs/document-worker-bootstrap-file
Open

AjmalAlkhaledi wants to merge 1 commit into
amphp:2.xfrom
AjmalAlkhaledi:docs/document-worker-bootstrap-file

Conversation

@AjmalAlkhaledi

Copy link
Copy Markdown

Addresses #201 (documentation).

ContextWorkerFactory's first constructor argument ($bootstrapPath) is a bootstrap file that is appended to the worker script and required in every worker before any task runs (see task-runner.php). It's the intended place to register a non-Composer autoloader or do per-worker setup — but it isn't mentioned in the README, which (as #201 notes) can send users down the wrong path.

This adds a short Bootstrapping workers subsection under Workers with the ContextWorkerFactory/ContextWorkerPool usage and a bootstrap-file example. Documentation only — no code changes.

ContextWorkerFactory's first argument is a bootstrap file that is required in
every worker before any task runs — the place to register a non-Composer
autoloader or do per-worker setup. Documents amphp#201.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant