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 a new time limit receiver#27130

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:masterfromsdelicata:feat_time_limit
May 4, 2018

Conversation

@sdelicata
Copy link
Contributor

QA
Branch?master for features
Bug fix?no
New feature?yes
BC breaks?no
Deprecations?no
Tests pass?yes
LicenseMIT

New feature to add a time limit option to the ConsumeMessagesCommand.

bin/console messenger:consume-messages <receiver-name> -t 3600

private$timeLimit;
private$logger;

publicfunction__construct(ReceiverInterface$decoratedReceiver,int$timeLimit,LoggerInterface$logger =null)
Copy link
Contributor

Choose a reason for hiding this comment

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

please name the variable like $timeLimitInSeconds to make it clear what unit this is in

if ($endTime <time()) {
$this->stop();
if (null !==$this->logger) {
$this->logger->info('Receiver stopped due to time limit of {timeLimit} reached',array('timeLimit' =>$this->timeLimit));
Copy link
Contributor

Choose a reason for hiding this comment

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

unit seconds missing


$timeoutReceiver =newStopWhenTimeLimitIsReachedReceiver($decoratedReceiver,1,$logger);
$timeoutReceiver->receive(function () {
sleep(2);

Choose a reason for hiding this comment

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

in order to not really wait for 2s during tests, the test case should be@group time-sensitive

sdelicata reacted with thumbs up emoji
@nicolas-grekasnicolas-grekas added this to the4.1 milestoneMay 2, 2018
<info>php %command.full_name% <receiver-name> --memory-limit=128M</info>
Use the --time-limit option to stop the worker if it the given time limit is reached:
Copy link
Contributor

Choose a reason for hiding this comment

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

- if it+ when
- given time limit+ given time limit (in seconds)

@sroze
Copy link
Contributor

@sdelicata your commits have multiple authors: could you squash them into one for us please?

@sdelicata
Copy link
ContributorAuthor

@sroze Done !

@sroze
Copy link
Contributor

Thank you@sdelicata.

@srozesroze merged commit5536ee1 intosymfony:masterMay 4, 2018
sroze added a commit that referenced this pull requestMay 4, 2018
This PR was merged into the 4.1-dev branch.Discussion----------[Messenger] Add a new time limit receiver| Q             | A| ------------- | ---| Branch?       | master for features| Bug fix?      | no| New feature?  | yes| BC breaks?    | no     <!-- seehttps://symfony.com/bc -->| Deprecations? | no| Tests pass?   | yes| License       | MITNew feature to add a time limit option to the ConsumeMessagesCommand.```bin/console messenger:consume-messages <receiver-name> -t 3600```Commits-------5536ee1 Add a new time limit receiver
@fabpotfabpot mentioned this pull requestMay 7, 2018
if ($endTime <time()) {
$this->stop();
if (null !==$this->logger) {
$this->logger->info('Receiver stopped due to time limit of {timeLimit}s reached',array('timeLimit' =>$this->timeLimitInSeconds));

Choose a reason for hiding this comment

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

use short array syntax

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

Reviewers

@nicolas-grekasnicolas-grekasnicolas-grekas left review comments

+3 more reviewers

@lucchese-pdlucchese-pdlucchese-pd left review comments

@TobionTobionTobion approved these changes

@srozesrozesroze approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

4.1

Development

Successfully merging this pull request may close these issues.

6 participants

@sdelicata@sroze@nicolas-grekas@Tobion@lucchese-pd@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp