-
Notifications
You must be signed in to change notification settings - Fork 4
Description
The problem/use-case that the feature addresses
The metadata commands (TS.QUERYINDEX, TS.CARD, TS.LABELNAMES, TS.LABELVALUES, TS.STATS) access data external to the Valkey database. However fanout commands generate responses using a locked Context. Additionally, commands which construct output in stages could benefit from more fine-grained locking.
Description of the feature
In those cases, we should use the ability to generate the reply without holding the GIL.
Alternatives you've considered
Any alternative solutions or features you've considered, including references to existing open and closed feature requests in this repository.
Additional information
For fanout, our internal state maintains a ThreadSafeContext with a blocked client. When calling FanoutOperation::generate_reply, we lock the thread context and return the returned Context. We could instead return the ThreadSafeContext, or better yet, encapsulate it in a newtype with reply methods (which do not require a lock).