amphp / amphp/parallel

Documentation: mention bootstrap file for workers

Open
#201 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

documentation
Dominant language
PHP
Stars
859
Forks
69
PR merge metrics
No merged PRs in 30d

Description

It would have saved me a significant amount of time in development if I had known that I could supply a bootstrap file for workers. The documentation AND ERROR MESSAGES use "MUST be loadable by the composer class loader", which is not true. That guidance caused me to go through hoops when a simple one-line bootstrap file importing my autoloader would have sufficed.

Instead, all I had to do was:

	$workerFactory = new ContextWorkerFactory(__DIR__ . '/../Task/bootstrap.php');
	$this->workerPool ??= new ContextWorkerPool(50, $workerFactory);

I shouldn't have to stumble upon an important feature like that while reverse-engineering your library for another reason.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Search the documentation and error messages for the guidance that workers must be loadable by the Composer class loader, then inspect the ContextWorkerFactory entry point and its bootstrap-file argument. Done means the documentation and errors accurately explain that a one-line bootstrap file importing the autoloader can be supplied.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
Half a day
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.