Aerospike C Async APIs and epoll handling


I am working on client server model. We have a server daemon which is continuously running. Multiple clients connect to this server. The server daemon handles connections on normal TCP/IP socket calls. We use epoll based event handling mechanism to service multiple clients. We do not create a separate thread or process for each client. Multiple clients can send multiple requests on existing connection.

The server daemon would like to connect with Aerospike cluster therefore, Aerospike client is integrated with server daemon. We would like to use Asynchronous APIs to store/read data from Aerospike cluster.

I would like to know, how to combine these two separate async event handling together? Is there any way I can associate an eventfd with Aerospike event handling framework. If yes, I can add eventfd can in epoll.

Thanks and Regards, Prasad

I recommend using libev for event handling your server daemon. libev uses epoll underneath when epoll is available. The Aerospike client library supports libev (and libuv) so your server could then share event loops.

The alternative is to use separate event loops for your server code and Aerospike client. This would allow your server code to continue to use epoll directly.

© 2015 Copyright Aerospike, Inc. | All rights reserved. Creators of the Aerospike Database.