author | Pierre-Yves Ritschard <pyr@spootnik.org> | |
Thu, 20 Nov 2014 10:30:33 +0000 (11:30 +0100) | ||
committer | Pierre-Yves Ritschard <pyr@spootnik.org> | |
Thu, 20 Nov 2014 10:30:33 +0000 (11:30 +0100) | ||
commit | bb54fd1902984a9130025d277f5cc3411d4c2f8b | |
tree | 13e4a0ec872c5a5e892f4f0d4781969198b86a6e | tree | snapshot |
parent | 50caaa588a84e0109e555789b83f84a4baf69105 | commit | diff |
add support for custom commands in redis plugin
Now that the redis plugin has moved to hiredis, it could
be worthwhile to add support for custom commands.
This diff implements a mechanism for executing commands which
allows for setting the type and type-instance. It doesn not
support hash or array returns, but if this is deemed necessary
could be added later on.
The canonical use case for this is for people using redis
has a queue (for instance, using solutions such as rq,
sidekiq and similar solutions) who want a simple way to
ensure the work queue size is not growing. To address this
you would use:
```
<Plugin redis>
<Node local>
<Command "queue_length">
Exec "LLEN myqueue"
Instance "myqueue"
</Command>
</Node>
</Plugin>
```
This would then produce a redis-local/queue_length-myqueue value.
If the idea has traction I'll add the doc bits.
Now that the redis plugin has moved to hiredis, it could
be worthwhile to add support for custom commands.
This diff implements a mechanism for executing commands which
allows for setting the type and type-instance. It doesn not
support hash or array returns, but if this is deemed necessary
could be added later on.
The canonical use case for this is for people using redis
has a queue (for instance, using solutions such as rq,
sidekiq and similar solutions) who want a simple way to
ensure the work queue size is not growing. To address this
you would use:
```
<Plugin redis>
<Node local>
<Command "queue_length">
Exec "LLEN myqueue"
Instance "myqueue"
</Command>
</Node>
</Plugin>
```
This would then produce a redis-local/queue_length-myqueue value.
If the idea has traction I'll add the doc bits.
src/redis.c | diff | blob | history |