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

[WIP] Blocking command support #356

Draft
wants to merge 18 commits into
base: main
Choose a base branch
from
Draft

Conversation

TalZaccai
Copy link
Contributor

@TalZaccai TalZaccai commented May 2, 2024

  • Adding support for blocking commands in Garnet (for List and SortedSet objects)
  • Implementing logic for BRPOP/BLPOP commands

Still remaining to address in this PR:

  • Block processing of further commands once a blocking command has been called
  • Stop the main loop in CollectionItemBroker if there are no active observers
  • Periodically clean up "zombie" observers (observers whose resp session has disposed but are still on the key's observer queue)
  • Remove keys whose observer queues are empty
  • Add more test cases

@TalZaccai TalZaccai requested a review from badrishc May 2, 2024 22:37
@TalZaccai TalZaccai added enhancement New feature or request API labels May 2, 2024
return false;

var arrKeys = keys.Select(k => k.Span.ToArray()).ToArray();
var result = itemBroker.GetListItemAsync(arrKeys, lop, this, timeout).Result;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait on a SemaphoreSlim here, that can be canceled (using a cancellation token) if the socket is killed or the session dies for some reason (i.e., session Dispose gets called).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants