Skip to content

Commit 37ca082

Browse files
committed
DOC-5504: update modules API doc
1 parent 483e235 commit 37ca082

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

content/develop/reference/modules/modules-api-ref.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5088,6 +5088,31 @@ write actions, please refer to [`RedisModule_AddPostNotificationJob`](#RedisModu
50885088

50895089
See [https://redis.io/docs/latest/develop/use/keyspace-notifications/](https://redis.io/docs/latest/develop/use/keyspace-notifications/) for more information.
50905090

5091+
<span id="RedisModule_UnsubscribeFromKeyspaceEvents"></span>
5092+
5093+
### `RedisModule_UnsubscribeFromKeyspaceEvents`
5094+
5095+
int RedisModule_UnsubscribeFromKeyspaceEvents(RedisModuleCtx *ctx,
5096+
int types,
5097+
RedisModuleNotificationFunc callback);
5098+
5099+
**Available since:** unreleased
5100+
5101+
5102+
[`RedisModule_UnsubscribeFromKeyspaceEvents`](#RedisModule_UnsubscribeFromKeyspaceEvents) - Unregister a module's callback from keyspace notifications for specific event types.
5103+
5104+
This function removes a previously registered subscription identified by both the event mask and the callback function.
5105+
It is useful to reduce performance overhead when the module no longer requires notifications for certain events.
5106+
5107+
Parameters:
5108+
- ctx: The `RedisModuleCtx` associated with the calling module.
5109+
- types: The event mask representing the keyspace notification types to unsubscribe from.
5110+
- callback: The callback function pointer that was originally registered for these events.
5111+
5112+
Returns:
5113+
- `REDISMODULE_OK` on successful removal of the subscription.
5114+
- `REDISMODULE_ERR` if no matching subscription was found or if invalid parameters were provided.
5115+
50915116
<span id="RedisModule_AddPostNotificationJob"></span>
50925117

50935118
### `RedisModule_AddPostNotificationJob`
@@ -8636,6 +8661,7 @@ There is no guarantee that this info is always available, so this may return -1.
86368661
* [`RedisModule_UnblockClient`](#RedisModule_UnblockClient)
86378662
* [`RedisModule_UnlinkKey`](#RedisModule_UnlinkKey)
86388663
* [`RedisModule_UnregisterCommandFilter`](#RedisModule_UnregisterCommandFilter)
8664+
* [`RedisModule_UnsubscribeFromKeyspaceEvents`](#RedisModule_UnsubscribeFromKeyspaceEvents)
86398665
* [`RedisModule_ValueLength`](#RedisModule_ValueLength)
86408666
* [`RedisModule_WrongArity`](#RedisModule_WrongArity)
86418667
* [`RedisModule_Yield`](#RedisModule_Yield)

0 commit comments

Comments
 (0)