GithubHelp home page GithubHelp logo

redislabs / rmnotify Goto Github PK

View Code? Open in Web Editor NEW
2.0 8.0 2.0 86 KB

A library for key and event space Notifications for Redis Modules

License: BSD 2-Clause "Simplified" License

Makefile 5.29% C 94.71%

rmnotify's Introduction

rmnotify

In Redis it's possible to subscribe to Pub/Sub channels in order to receive events affecting the Redis data set in some way, see docs.

For example, you might be interested in knowing about all operations touching a certain key (key space notification), or you might want to know if all keys have been deleted (event space notification).

Unfortunately, the Redis modules API has yet to support module registration for either key/event space notifications. Until native support is implemented you can use this library to register for both key and event space notifications.

Usage

To receive notifications for a specific key ("foo") call

void fnKeyNotify(const char* key, const char* event) {...}
notifierRegisterKey(notifier, "foo", fnKeyNotify);

And for event ("del") notifications:

void fnEventNotify(const char* event, const char* key) {...}
notifierRegisterEvent(notifier, "del", fnEventNotify);

See either demo.c or test.c for additional examples.

Build

Build dependencies, from rmnotify_root/deps/hiredis run:

make

Build rmnotify, from rmnotify_root/src run:

make all

Run tests (make sure a local Redis server is running), from rmnotify_root/src/test run:

make test && ./test

rmnotify's People

Contributors

swilly22 avatar dvirsky avatar itamarhaber avatar

Stargazers

Aric Huang avatar Simone Mosciatti avatar

Watchers

Simone Mosciatti avatar James Cloos avatar Yiftach avatar Matan Kehat avatar  avatar Uri Shachar avatar Elad Ash avatar  avatar

rmnotify's Issues

[FR] user-provided connection information

There should to be a way for the library's user to specify the connection's properties. These are:

  • TCP connections: hostname or IP address, and port
  • UDS: path to socket
  • Authentication password

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.