Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Messenger] Add BatchAsyncHandlerTrait for ParallelMessageBus#60080

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
matyo91 wants to merge2 commits intosymfony:7.4
base:7.4
Choose a base branch
Loading
frommatyo91:messenger-handling-concurrent-messages

Conversation

matyo91
Copy link
Contributor

QA
Branch?7.3
Bug fix?no
New feature?yes
Deprecations?no
IssuesFix#53964 (comment)
LicenseMIT

Key Features

This implementation enables efficient batch processing while taking advantage of the parallel execution capabilities of ParallelMessageBus.

Usage Example

Here's how you would use this trait in a handler class:

class MyParallelBatchHandler{use BatchAsyncHandlerTrait;publicfunction__construct(ParallelMessageBus$parallelBus)    {$this->setParallelMessageBus($parallelBus);    }publicfunction__invoke(MyMessage$message)    {return$this->handle($message,null);    }privatefunctionprocess(array$jobs):void    {// This is the fallback implementation that will only be used// if ParallelMessageBus is not available/set// Extract message data$data =array_map(fn($job) =>$job[0]->getData(),$jobs);// Perform batch processing// ...// Acknowledge all messagesforeach ($jobsas [$message,$ack]) {$ack->ack();        }    }}

@carsonbotcarsonbot added this to the7.3 milestoneMar 28, 2025
@matyo91matyo91force-pushed themessenger-handling-concurrent-messages branch from97e4cd7 toa571a81CompareMarch 28, 2025 22:06
@matyo91matyo91force-pushed themessenger-handling-concurrent-messages branch froma571a81 to29b4e97CompareMarch 28, 2025 22:07
@carsonbotcarsonbot changed the titleAdd BatchAsyncHandlerTrait for ParallelMessageBus[Messenger] Add BatchAsyncHandlerTrait for ParallelMessageBusMar 30, 2025
@fabpotfabpot modified the milestones:7.3,7.4May 26, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Projects
None yet
Milestone
7.4
Development

Successfully merging this pull request may close these issues.

5 participants
@matyo91@fabpot@OskarStark@carsonbot@alli83

[8]ページ先頭

©2009-2025 Movatter.jp