You can register RedisGears functions to run when certain events occur in a Redis database.

Register on events

To register RedisGears functions to run on an event, your code needs to:

  1. Pass KeysReader to a GearsBuilder object.

  2. Call the GearsBuilder.register() function.

  3. Pass the eventTypes parameter to either:

    • The register function for Python.

    • The KeysReader object for Java.

For more information and examples of event registration, see:

Event types

For the list of event types you can register on, see the Redis keyspace notification documentation.

Active-Active event types

In addition to standard Redis events, Redis Enterprise Active-Active databases also support the registration of RedisGears functions for the following event types:

  • change: This event occurs when a key changes on another replica of the Active-Active database.