Send a message to all the nodes in the cluster if `target` is NULL, otherwise * at the specified target, which is a REDISMODULE_NODE_ID_LEN bytes node ID, as * returned by the receiver callback or by the nodes iteration functions. * * The function returns REDISMODULE_OK if the message was successfully sent, * otherwise if the node is not connected or such node ID does not map to any * known
| 6074 | * otherwise if the node is not connected or such node ID does not map to any |
| 6075 | * known cluster node, REDISMODULE_ERR is returned. */ |
| 6076 | int RM_SendClusterMessage(RedisModuleCtx *ctx, char *target_id, uint8_t type, unsigned char *msg, uint32_t len) { |
| 6077 | if (!server.cluster_enabled) return REDISMODULE_ERR; |
| 6078 | uint64_t module_id = moduleTypeEncodeId(ctx->module->name,0); |
| 6079 | if (clusterSendModuleMessageToTarget(target_id,module_id,type,msg,len) == C_OK) |
| 6080 | return REDISMODULE_OK; |
| 6081 | else |
| 6082 | return REDISMODULE_ERR; |
| 6083 | } |
| 6084 | |
| 6085 | /* Return an array of string pointers, each string pointer points to a cluster |
| 6086 | * node ID of exactly REDISMODULE_NODE_ID_SIZE bytes (without any null term). |
nothing calls this directly
no test coverage detected