-
Notifications
You must be signed in to change notification settings - Fork 772
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Processor.Shutdown to meet with the latest spec #1282
Conversation
} | ||
|
||
try | ||
{ | ||
this.OnShutdown(timeoutMilliseconds); | ||
return true; // TODO: update exporter.OnShutdown to return boolean |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Put this return true
to the end of this function (right before }
)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The way I look at try { return } catch() { return }
is similar to if() { return } else { return }
. Do you see some benefit of putting it outside?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought normal execution flow would end at }
, besides that, I don't see any advantage to move return true
to the end of the function.
Codecov Report
@@ Coverage Diff @@
## master #1282 +/- ##
==========================================
- Coverage 79.13% 79.10% -0.03%
==========================================
Files 215 215
Lines 6174 6170 -4
==========================================
- Hits 4886 4881 -5
- Misses 1288 1289 +1
|
Interesting! What is user to do if shutdown comes back false? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I guess 99% users won't consume the return value. One real world scenario: one can check the |
The latest spec requires the processor
Shutdown
to provide a way to indicate whether it succeeded or not.Changes
ActivityProcessor.Shutdown
to return bool.For significant contributions please make sure you have completed the following items:
CHANGELOG.md
updated for non-trivial changes