-
Notifications
You must be signed in to change notification settings - Fork 66
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 support for Command filter #168
base: master
Are you sure you want to change the base?
Conversation
Co-authored-by: Omer Shadmi <[email protected]>
…ule-rs into command_filter
unsafe { raw::RedisModule_CommandFilterArgsCount.unwrap()(self.ctx) as usize } | ||
} | ||
|
||
pub fn args_get(&self, pos: usize) -> Option<RedisString> { |
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.
The naming is inconsistent with the Redis APIs: "args" vs "arg". Although the APIs are themselves a bit inconsistently named, let's at least not add even more to the confusion and use the same names here.
In any case, it's probably best to wrap this low-level API wrapper with a higher level idiomatic Rust API (e.g. providing an iterator over the args), but that's not urgent.
status | ||
} | ||
|
||
pub fn args_replace(&self, pos: usize, arg: RedisString) -> Status { |
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.
The insert
and replace
functions are mostly identical; it may make sense to unify the common code (freeing the strings etc.)
@@ -82,6 +82,31 @@ macro_rules! redis_event_handler { | |||
}}; | |||
} | |||
|
|||
#[cfg(feature = "experimental-api")] | |||
#[macro_export] | |||
macro_rules! redis_commnad_filter { |
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.
Typo:
macro_rules! redis_commnad_filter { | |
macro_rules! redis_command_filter { |
No description provided.