Giter VIP home page Giter VIP logo

redelay's Introduction

ReDelay

Schedule commands in Redis.

⚠️ This is a work in progress ⚠️

Example

See the ./examples folder.

Commands

SCHEDULE.ADD KEY DELAY COMMAND [ARG ...]

Schedule a command (COMMAND + ARGS) to execute in DELAY seconds. This returns the task's id (a v4 uuid).

SCHEDULE.REM KEY TASK-ID

Remove a task from a schedule by its id.

SCHEDULE.SCAN KEY

List all the tasks (id, timestamp, command) present in a schedule (do not includes the executed ones).

SCHEDULE.INCRBY KEY TASK-ID SECONDS

Delay a task even further

SCHEDULE.DECRBY KEY TASK-ID SECONDS

Speed up a task

SCHEDULE.REPLICATE KEY TIMESTAMP TASK-ID COMMAND [ARG ...]

Internal command to replicate/restore schedule from/to AOF.

SCHEDULE.EXEC (CAUSES THE TASK SIDE EFFECT)

Executes a task, triggering its command.

Build and run

You can build the library with cargo:

cargo build --release

Simply load it in Redis as any other module:

redis-server --loadmodule ./target/release/libredelay.so

Running tests

cargo t --features test

... Or ...

make test

Running all integration tests (in docker)

make start-all

TODO

  • RDB Support
  • Validate commands on receive
  • Cluster support
  • Do not start/execute timers on replicas?
  • Test coverage
  • Fix all clippy warnings
  • Suppress clippy error from redis-module
  • Example with streams
  • Create timers after AOF restore
  • Move timer create/update into event module
  • RDB integration tests
  • Test for key removed
  • Test for cluster replication
  • Dead-letter

redelay's People

Contributors

rcelha avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

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.