A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/wandenberg/redis_nginx_adapter below:

wandenberg/redis_nginx_adapter: Adapter to use hiredis with async connections inside a nginx module

An adapter to use the events structure from Nginx on communication with redis, using redis asynchronous context. It requires hiredis >= 0.11.0, and Nginx headers.

redis_nginx_init();
redisAsyncContext *redis_server = NULL;
if (redis_nginx_open_context((const char *) "localhost", 6379, 0, NULL, &redis_server) != NULL) {
    redisAsyncCommand(redis_server, NULL, NULL, "SET %b %d-%d", r->uri.data, r->uri.len, r->headers_out.status, r->headers_out.content_length_n);
}
redis_nginx_close_context(&redis_server);
redis_nginx_init();
redisAsyncContext *redis_server = NULL;
if (redis_nginx_open_context((const char *) "localhost", 6379, 0, (const char*) "password", &redis_server) != NULL) {
    redisAsyncCommand(redis_server, NULL, NULL, "SET %b %d-%d", r->uri.data, r->uri.len, r->headers_out.status, r->headers_out.content_length_n);
}
redis_nginx_close_context(&redis_server);

At the example/module folder there is a very basic Nginx module that uses the library. And a Dockerfile that demonstrate how to build and run it.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4