Skip to content
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

Why connection exception for empty queue? #9

Open
adelgadocabrera opened this issue Apr 4, 2022 · 2 comments
Open

Why connection exception for empty queue? #9

adelgadocabrera opened this issue Apr 4, 2022 · 2 comments

Comments

@adelgadocabrera
Copy link
Collaborator

I don't understand why throw connection exception for empty list? Why not just return null? Perhaps I'm not seeing something.

https://github.com/CS682-S22/dsd-pub-sub-project-anchitbhatia/blob/1cdf79e83816160c8ea636020afb70f7988ad19b/src/main/java/api/Consumer.java#L46-L48

@anchitbhatia
Copy link
Owner

This is to differentiate whether the connection is closed or timeout occurred while polling (returns null). If i would have just returned null then the application would still keep on polling from the queue even when the connection is closed.

@adelgadocabrera
Copy link
Collaborator Author

Oh, I see I see. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants