-
Notifications
You must be signed in to change notification settings - Fork 450
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
Added methods to poll the state of the PushManager
and its client threads
#3
Conversation
…to pushmanagerstate
I think this is a good idea, but would you mind adding a couple unit tests? I'd love to make sure that Also (and I acknowledge this is nit-picky), would you mind adding a short body to the javadoc comments you added for stylistic consistency? Thanks kindly! |
I added javadoc bodies and implemented some unit tests, but I'm not 101% sure they're correct...let me know what you think :) |
public void testIsRunning() throws InterruptedException { | ||
PushManager pm = this.getPushManager(); | ||
|
||
pm.start(); |
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 might add assertFalse(pm.isRunning())
before starting the push manager, but otherwise, I think this looks great!
Oops -- mis-click. Sorry! |
I guess your idea of maintaining an internal flag is probably better than mine, since the actual implementation has an issue: you're right in saying that We could solve this problem adding a Going to do this as soon as I find some time. |
Cool. Thanks for sticking with it!
Actually, I think I'm going to need to do that in #4 anyhow. Will keep you posted. |
So I've made the check-client-state strategy even less feasible in #4 because I, uh, maybe got rid of |
I don't have a real connection available at the moment, will have a look
|
…vent loop group and the getExpiredTokens method has changed a bit. This should also cover what we were trying to do in #3.
Yep makes sense to me. |
Referring to issue #2, I added a couple of methods to make the PushManager state explicit; they actually shouldn't be necessary, since the
shutdown
andstart
method already don't shut down the connection or open them if they're already in the expected state, but I feel like this way is a little clearer and thePushManager.isRunning()
method may come in handy.What do you think?