-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Add ResultProcessor #2114
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
Add ResultProcessor #2114
Conversation
Abstraction is a thread that processes results in the result queue by passing each result from the queue to the ResultRecorder and ResultPrinter.
| except queue.Empty: | ||
| pass | ||
|
|
||
| def _process_result(self, result): |
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.
Is it worth just having a generic ResultHandler interface and having the __init__ take a list of result handlers? You could then either write adapters for the recorder/printer or update them to have the same interface.
What do you think?
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.
Posssibly. I was actually considering doing that. The only reason I did not was because I did not see needing it in doing the port, but taking an arbitrary list of handlers is pretty flexible so I would be totally fine with making that the interface.
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.
Yeah, don't feel too strongly about it for this specific PR, it would just clean up the code a little bit:
for handler in self._result_handlers:
handler.handle_result(result)
vs. having to check if a particular handler was None or not.
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'm updating it. I did not like the None check either.
It now accepts a list of handlers to call when processing through the result queue.
|
I assume we're going to just change the existing recorder/printer to just have a |
|
@jamesls I realized that as well when I was looking over the first commit I pushed. You just beat me to it. I went a head and changed the interface to use |
|
|
Abstraction is a thread that processes results in the result queue by
passing each result from the queue to the ResultRecorder and ResultPrinter.
cc @jamesls @JordonPhillips