Add worker console messages (write/writeln) alongside ProgressBar - #28
Merged
Conversation
- Add ParallelWorker::write() and ParallelWorker::writeln() methods. - Route messages through ProgressBarWorker when a progress bar is active (clear/write/display). - Add a ConsoleWorker fallback for workers without a progress bar. - Use a shared stderr OutputInterface so ProgressBar and messages share the same stream. - Add WriteOutputMessage command and ConsoleWorker/HasChannels infrastructure. - Update README and CHANGELOG. Co-Authored-By: Hermann D. Schimpf <hschimpf@hds-solutions.net>
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Co-Authored-By: Hermann D. Schimpf <hschimpf@hds-solutions.net>
Co-Authored-By: Hermann D. Schimpf <hschimpf@hds-solutions.net>
hschimpf
requested changes
Jul 23, 2026
Co-Authored-By: Hermann D. Schimpf <hschimpf@hds-solutions.net>
Co-Authored-By: Hermann D. Schimpf <hschimpf@hds-solutions.net>
…to STDERR Co-Authored-By: Hermann D. Schimpf <hschimpf@hds-solutions.net>
Co-Authored-By: Hermann D. Schimpf <hschimpf@hds-solutions.net>
Co-Authored-By: Hermann D. Schimpf <hschimpf@hds-solutions.net>
Co-Authored-By: Hermann D. Schimpf <hschimpf@hds-solutions.net>
This was referenced Jul 23, 2026
…d ProgressBarWorker, avoid raw STDERR writes, disable opcache JIT in CI Co-Authored-By: Hermann D. Schimpf <hschimpf@hds-solutions.net>
…leWorker Co-Authored-By: Hermann D. Schimpf <hschimpf@hds-solutions.net>
Co-Authored-By: Hermann D. Schimpf <hschimpf@hds-solutions.net>
Co-Authored-By: Hermann D. Schimpf <hschimpf@hds-solutions.net>
…gressBarWorker Co-Authored-By: Hermann D. Schimpf <hschimpf@hds-solutions.net>
Co-Authored-By: Hermann D. Schimpf <hschimpf@hds-solutions.net>
Co-Authored-By: Hermann D. Schimpf <hschimpf@hds-solutions.net>
Co-Authored-By: Hermann D. Schimpf <hschimpf@hds-solutions.net>
Co-Authored-By: Hermann D. Schimpf <hschimpf@hds-solutions.net>
Co-Authored-By: Hermann D. Schimpf <hschimpf@hds-solutions.net>
hschimpf
requested changes
Jul 24, 2026
hschimpf
left a comment
Owner
There was a problem hiding this comment.
Requesting changes pending a few cleanups:
tests/ParallelTest.phpstill has debugfwrite(STDOUT, ...)insetUp/tearDown/runWorkerScriptthat should be removed or gated.testThatWorkerCanWriteMessagesWithProgressBaronly asserts substring presence; add ordering/negative assertions to prove messages are not overwritten by the bar.- The
@file_put_contents('php://stderr', ...)fallback inCommunicatesWithProgressBarWorkershould usefwrite(STDERR, ...)instead and drop@. - Update
docs/RFC-progressbar-console-messages.mdimplementation outline to match the final Runner-owned design. - Please resolve/answer the open threads about
ConsoleOutput→StreamOutputand the trait name mismatch.
Once those are addressed, this looks good to merge.
- Remove debug timestamps from ParallelTest - Strengthen progressbar message assertions with ordering checks - Use fopen/fwrite for stderr fallback instead of @file_put_contents - Update RFC implementation outline to final Runner-owned design - Rename CommunicatesWithProgressBarWorker to CommunicatesWithRunner - Only send progress/stats actions when progress is enabled - Finish ProgressBar on shutdown to leave terminal clean - Explain StreamOutput choice over ConsoleOutput Co-Authored-By: Hermann D. Schimpf <hschimpf@hds-solutions.net>
Co-Authored-By: Hermann D. Schimpf <hschimpf@hds-solutions.net>
hschimpf
approved these changes
Jul 24, 2026
…dler Co-Authored-By: Hermann D. Schimpf <hschimpf@hds-solutions.net>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds
write()/writeln()toParallelWorkerso workers can emit console messages while aProgressBaris active, without the bar overwriting them.How it works
ParallelWorkergainswrite()/writeln()viaCommunicatesWithProgressBarWorker.WriteOutputMessagecommand to theRunnerthread.Runnerowns the SymfonyProgressBarand aStreamOutputonphp://stderr.Runnerdoesclear()→ write the message →display(); otherwise it writes directly.setMessage()/advance()keep working as before; memory and items-per-second stats continue to be updated on the same bar.Why the Runner owns the output
The RFC originally explored a separate
ConsoleWorker/progress thread, but routing everything through the existingRunnerchannel keeps the coordinator in one place and avoids sharingSTDERRacross threads. TheRunnermain thread is the only place that writes tophp://stderr.Tests
testThatWorkerCanWriteMessagesWithoutProgressBarspawns a separate PHP process and verifiesStarting #n/Done #nmessages.testThatWorkerCanWriteMessagesWithProgressBarverifies the messages are interleaved with progress-bar redraws and the bar reaches3 of 3:.Notes
Contracts\ParallelWorkeris unchanged; the methods are added on the abstractParallelWorkerclass.opcache.jitis disabled because JIT +ext-parallelcan deadlock.Link to Devin session: https://app.devin.ai/sessions/aa44109acb6346c2abd6b14c45072be7
Requested by: @hschimpf