content/operate/oss_and_stack/stack-with-enterprise/gears-v1/register-events.md
You can register RedisGears functions to run when certain events occur in a Redis database.
To register RedisGears functions to run on an event, your code needs to:
Pass KeysReader to a GearsBuilder 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:
[KeysReader]({{< relref "/operate/oss_and_stack/stack-with-enterprise/gears-v1/jvm/classes/readers/keysreader" >}})
[GearsBuilder.register()]({{< relref "/operate/oss_and_stack/stack-with-enterprise/gears-v1/jvm/classes/gearsbuilder/register" >}})
For the list of event types you can register on, see the [Redis keyspace notification documentation]({{< relref "/develop/pubsub/keyspace-notifications" >}}#events-generated-by-different-commands).
In addition to standard Redis [events]({{< relref "/develop/pubsub/keyspace-notifications" >}}#events-generated-by-different-commands), [Redis Software Active-Active databases]({{< relref "/operate/rs/databases/active-active" >}}) 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.