Register events
Register RedisGears functions to run when certain events occur in a Redis database.
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:
-
Pass
KeysReader
to aGearsBuilder
object. -
Call the
GearsBuilder.register()
function. -
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:
-
Java references:
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.