Queues: unified, nicer runner method #1816
Merged
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.
When hacking on SDN stuff, I came up with a nicer top-level runner method that I wanted all the other queues (FIFO, PIFO, PIFO tree) to start using as well. The important change is that:
Before
The
main
component would:After
The
main
component:runner
component that thereafter serves as the handle to the queue component. Ifmain
was passed a stats component, it sets up the runner to also use that stats component. The runner has the list of commands, as is in charge of feeding the queue one command at each invocation of the runner. The runner also returns to its caller any answers (from popping or peeking) and raises errors as needed.runner
.The SDN clients use the
main
component with all the optional fields filled, while the lighter-weight FIFO, PIFO, PIFOtree just use it without those fields.Closes #1770.