-
Notifications
You must be signed in to change notification settings - Fork 252
Prioritize reads from queue by message ID #138
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
Conversation
Decided to extract the logic into |
Shouldn't have unread messages but provide a way to measure it anyway.
|
||
result_pdu = nil | ||
controls = [] | ||
|
||
while pdu = read | ||
while pdu = queued_read(message_id) |
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 like how you've minimized changes to the existing search logic. It's a little strange that both this and queued_read
both have a while
loop, but I think this is a step in the right direction, and we can incrementally change this logic later on.
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.
Agree, though the practical impact here is that we'll just read in a loop until we get a result for the requested message_id
, but then when control switches to the other query, the queued messages will be quickly drained from the queue.
Does this fix the failing test you had for the |
🚢 |
Prioritize reads from queue by message ID
Prioritize reads from queue by message ID
This is an an alternative proposal (compared to #136) for the issues defined in #133. It aims for minimal changes to provide for correctness. The changes here are local to
Net::LDAP::Connection#search
but could be moved toNet::LDAP::Connection#read
instead.Thoughts?
NOTE: This is targeting the
open-integration-tests
branch since it was branched from there for testing/development.cc @jch @schaary