redis-cell | Redis module that provides rate | Command Line Interface library
kandi X-RAY | redis-cell Summary
kandi X-RAY | redis-cell Summary
A Redis module that provides rate limiting in Redis as a single command.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of redis-cell
redis-cell Key Features
redis-cell Examples and Code Snippets
Community Discussions
Trending Discussions on redis-cell
QUESTION
I'm building a Redis Module in Rust. I've found some good examples, but I'm stuck when dealing with interfacing a C function that is supposed to accept variadic arguments.
The Redis Module C SDK has a function called RedisModule_Call
which accepts a few specific arguments then n
arguments that represent a Redis command. From the Redis Module SDK documentation (in C):
ANSWER
Answered 2018-May-12 at 16:20You don't, at least not yet, and I'd wager probably never.
To be able to do this, you'd need two key abilities, both of which are outside of your control:
Redis needs to provide a function that accepts a
va_list
argument, not just a...
.It's strange that Redis doesn't already provide such a function, but perhaps this is a sign that other people implementing modules avoid the problem entirely.
Rust needs to provide a way to construct the
va_list
argument.While it looks like RFC 2137 will introduce a
VaList
type, the proposed API does not provide a way to create one or set values in it.
Note that you can't do what you want, even in C (at least not easily or portably).
What can you do instead? Assuming that you are implementing the code that consumes the variadic arguments, you can remove the variation from your call. A collection of items in C is just a pointer and a length, so pass that instead:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install redis-cell
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page