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 WorkerStoppedEvent#31282

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

Merged
sroze merged 1 commit intosymfony:masterfromchalasr:messenger-worker-stop
Apr 28, 2019

Conversation

@chalasr
Copy link
Member

@chalasrchalasr commentedApr 26, 2019
edited
Loading

QA
Branch?4.3
Bug fix?no
New feature?yes
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed ticketsn/a
LicenseMIT
Doc PRn/a

In 4.2, one was able to decorate a transport and hook intoTransportInterface::stop() to perform some business tasks when themessenger:consume process gets killed.
In 4.3 thestop() logic has been moved toWorker which cannot be decorated when used viamessenger:consume.
This PR adds a marker event dispatched when the worker is stopped to provide the same capability.

Briefly discussed with@weaverryan.
My use case:
I have a temporary CSV file locally which grows while consuming jobs.
This file is uploaded to AWS S3 and squashed once a while (every 5minutes). It is also uploaded when themessenger:consume process gets stopped (to store the remaining lines).
For the former (time-based upload), I can listen onWorkflowMessageHandledEvent to make the upload happens in case the 5 minutes delay is elapsed. This solves the latter.

@chalasrchalasrforce-pushed themessenger-worker-stop branch from4733c22 to0e7898bCompareApril 27, 2019 18:22
Copy link
Contributor

@srozesroze left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Makes sense 👍

@sroze
Copy link
Contributor

Thank you@chalasr.

@srozesroze merged commit0e7898b intosymfony:masterApr 28, 2019
sroze added a commit that referenced this pull requestApr 28, 2019
This PR was merged into the 4.3-dev branch.Discussion----------[Messenger] Add WorkerStoppedEvent| Q             | A| ------------- | ---| Branch?       | 4.3| Bug fix?      | no| New feature?  | yes| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets | n/a| License       | MIT| Doc PR        | n/aIn 4.2, one was able to decorate a transport and hook into `TransportInterface::stop()` to perform some business tasks when the `messenger:consume` process gets killed.In 4.3 the `stop()` logic has been moved to `Worker` which cannot be decorated when used via `messenger:consume`.This PR adds a marker event dispatched when the worker is stopped to provide the same capability.Briefly discussed with@weaverryan.My use case:I have a temporary CSV file locally which grows while consuming jobs.This file is uploaded to AWS S3 and squashed once a while (every 5minutes). It is also uploaded when the `messenger:consume` process gets stopped (to store the remaining lines).For the former (time-based upload), I can listen on `WorkflowMessageHandledEvent` to make the upload happens in case the 5 minutes delay is elapsed. This solves the latter.Commits-------0e7898b [Messenger] Add WorkerStoppedEvent
@chalasrchalasr deleted the messenger-worker-stop branchApril 28, 2019 14:00
@nicolas-grekasnicolas-grekas modified the milestones:next,4.3Apr 30, 2019
@fabpotfabpot mentioned this pull requestMay 9, 2019
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@weaverryanweaverryanweaverryan approved these changes

@OskarStarkOskarStarkOskarStark approved these changes

+1 more reviewer

@srozesrozesroze approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

4.3

Development

Successfully merging this pull request may close these issues.

6 participants

@chalasr@sroze@weaverryan@OskarStark@nicolas-grekas@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp