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

[Process] Adds usleep(1000) to ease CPU usage.#28940

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
nicolas-grekas merged 1 commit intosymfony:masterfromminiyarov:master
Oct 23, 2018

Conversation

@miniyarov
Copy link
Contributor

QA
Branch?master
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets
LicenseMIT
Doc PRsymfony/symfony-docs

ercancavusoglu reacted with thumbs up emojismtaydemir reacted with hooray emojiercancavusoglu reacted with heart emoji
@miniyarovminiyarov changed the titleAdds usleep(1000) to ease CPU usage.[Process] Adds usleep(1000) to ease CPU usage.Oct 21, 2018
@nicolas-grekasnicolas-grekas added this to the4.2 milestoneOct 22, 2018
Copy link
ContributorAuthor

@miniyarovminiyarov left a comment

Choose a reason for hiding this comment

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

Break if process is not running in waitUntil

@miniyarov
Copy link
ContributorAuthor

@nicolas-grekas added a break if process is not running

$this->fallbackStatus['exitcode'] = (int)$data;
}
}
if ($this->isRunning()) {
Copy link
Member

@nicolas-grekasnicolas-grekasOct 22, 2018
edited
Loading

Choose a reason for hiding this comment

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

what about writting in this way:

if ($wait && !$this->isRunning()) {    return false;}

and make the function return a boolean (type-hint+return true at the end)

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Hmm this might change function's specification but doable

Copy link
Member

@nicolas-grekasnicolas-grekasOct 22, 2018
edited
Loading

Choose a reason for hiding this comment

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

The method is new so we can still do it. It'd make sense to me.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Ok updated to return a boolean.

Copy link
Member

@nicolas-grekasnicolas-grekas left a comment

Choose a reason for hiding this comment

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

(with one last comment, thanks!)

*
* @param callable $callback
*
* @return bool
Copy link
Member

@nicolas-grekasnicolas-grekasOct 22, 2018
edited
Loading

Choose a reason for hiding this comment

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

should be removed (same for $callback btw) as we remove docblocks that don't add anything on top of the PHP signature.

@miniyarov
Copy link
ContributorAuthor

@nicolas-grekas Thanks to you too!

@nicolas-grekas
Copy link
Member

Thank you@miniyarov.

miniyarov reacted with thumbs up emoji

@nicolas-grekasnicolas-grekas merged commit9d1416a intosymfony:masterOct 23, 2018
nicolas-grekas added a commit that referenced this pull requestOct 23, 2018
This PR was squashed before being merged into the 4.2-dev branch (closes#28940).Discussion----------[Process] Adds usleep(1000) to ease CPU usage.| Q             | A| ------------- | ---| Branch?       | master| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets || License       | MIT| Doc PR        | symfony/symfony-docsCommits-------9d1416a [Process] Adds usleep(1000) to ease CPU usage.
@stof
Copy link
Member

Could we have tests for this boolean return value ?

@nicolas-grekas
Copy link
Member

@stof please check#28958

Nek- added a commit to Nek-/symfony that referenced this pull requestOct 29, 2018
The while condition was the opposite of the previous while.This was obviously leading to the death of this loop. Loop whichwas useful according to some people (seesymfony#28940), so I just movedthe code to the right position.
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@dunglasdunglasdunglas approved these changes

@javiereguiluzjaviereguiluzjaviereguiluz approved these changes

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

+1 more reviewer

@Nek-Nek-Nek- approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

4.2

Development

Successfully merging this pull request may close these issues.

7 participants

@miniyarov@nicolas-grekas@stof@dunglas@javiereguiluz@Nek-@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp