If hiredis >= v1.1.0 is used an alternative connect callback can be registered using:
int redisClusterAsyncSetConnectCallbackNC(redisClusterAsyncContext *acc,
redisConnectCallbackNC *fn);
The callback function should have the following prototype, aliased to redisConnectCallbackNC:
void(redisAsyncContext *ac, int status);
The connect callback will be passed a non-const redisAsyncContext* on invocation which
e.g. allows the callback to set a push callback.
The build will check if the used hiredis version supports it, but the new API can also manually be disabled in a build via:
CFLAGS=-DHIRCLUSTER_NO_NONCONST_CONNECT_CB
Note: Not available on Windows. The file hiredis_cluster.def would need to include redisClusterAsyncSetConnectCallbackNC only when hiredis >= v1.1.0 and this requires special handling.
If
hiredis
>= v1.1.0 is used an alternative connect callback can be registered using:The callback function should have the following prototype, aliased to
redisConnectCallbackNC
:void(redisAsyncContext *ac, int status);
The connect callback will be passed a non-const
redisAsyncContext*
on invocation which e.g. allows the callback to set a push callback.The build will check if the used hiredis version supports it, but the new API can also manually be disabled in a build via:
CFLAGS=-DHIRCLUSTER_NO_NONCONST_CONNECT_CB
Note: Not available on Windows. The file
hiredis_cluster.def
would need to includeredisClusterAsyncSetConnectCallbackNC
only whenhiredis
>= v1.1.0 and this requires special handling.