MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / redisAsyncConnectWithOptions

Function redisAsyncConnectWithOptions

deps/hiredis/async.c:165–192  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

163}
164
165redisAsyncContext *redisAsyncConnectWithOptions(const redisOptions *options) {
166 redisOptions myOptions = *options;
167 redisContext *c;
168 redisAsyncContext *ac;
169
170 /* Clear any erroneously set sync callback and flag that we don't want to
171 * use freeReplyObject by default. */
172 myOptions.push_cb = NULL;
173 myOptions.options |= REDIS_OPT_NO_PUSH_AUTOFREE;
174
175 myOptions.options |= REDIS_OPT_NONBLOCK;
176 c = redisConnectWithOptions(&myOptions);
177 if (c == NULL) {
178 return NULL;
179 }
180
181 ac = redisAsyncInitialize(c);
182 if (ac == NULL) {
183 redisFree(c);
184 return NULL;
185 }
186
187 /* Set any configured async push handler */
188 redisAsyncSetPushCallback(ac, myOptions.async_push_cb);
189
190 __redisAsyncCopyError(ac);
191 return ac;
192}
193
194redisAsyncContext *redisAsyncConnect(const char *ip, int port) {
195 redisOptions options = {0};

Callers 6

redisAsyncConnectFunction · 0.85
redisAsyncConnectBindFunction · 0.85
redisAsyncConnectUnixFunction · 0.85
test_resp3_push_optionsFunction · 0.85
mainFunction · 0.85

Calls 5

redisConnectWithOptionsFunction · 0.85
redisAsyncInitializeFunction · 0.85
redisFreeFunction · 0.85
__redisAsyncCopyErrorFunction · 0.85

Tested by 1

test_resp3_push_optionsFunction · 0.68