Use flags instead of boolean args for App::run() - #4
Merged
Conversation
DaveRandom
force-pushed
the
patch/app-run-flags
branch
from
October 23, 2016 22:42
f0edb42 to
da8b95f
Compare
DaveRandom
commented
Oct 23, 2016
| } | ||
|
|
||
| uiMainStep(block); | ||
| uiMainStep((flags & PHP_UI_APP_RUN_BLOCK) == PHP_UI_APP_RUN_BLOCK); |
Contributor
Author
There was a problem hiding this comment.
Force arg passed to uiMainStep() to be 1 or 0. This is arguably unnecessary but seems like best practice?
krakjoe
reviewed
Oct 24, 2016
| uiApp_ce = zend_register_internal_class(&ce); | ||
| uiApp_ce->create_object = php_ui_app_create; | ||
|
|
||
| zend_declare_class_constant_long(uiApp_ce, ZEND_STRL("RUN_LOOP"), PHP_UI_APP_RUN_LOOP); |
Owner
There was a problem hiding this comment.
ui is using unconventional "Naming" for constants, we need to stick to that ...
But not sure what they should be, here's a suggestion:
- App::run() should just do uiMain()
- App::run(App::Loop) should do uiMainStep(0) - so that this will be the non-blocking, no-waiting option
- App::run(App::Loop | App::Wait) should do uiMainStep(1) - so that this will be the looping and blocking version
How about that ?
Contributor
Author
There was a problem hiding this comment.
👍
Will update shortly
DaveRandom
force-pushed
the
patch/app-run-flags
branch
from
October 24, 2016 06:40
b391b11 to
07b4df9
Compare
Contributor
Author
|
Naming fixed, updated example (which I forgot to do in the first place) + squashed for commit log tidiness |
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.
Untested but pretty simple