Skip to content

couchbaselabs/libev-couchbase-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 

Repository files navigation

Integration Demo

This demo shows how to integrate libcouchbase with the application which already use its own event loop, moreover, this event loop (in the example libev) built-in statically into host application.

In the directory step1 stored the application before integration: simple echo server which unlike popular echo server examples accessible in the internets, doesn't make an assumption that socket is writable on EV_READ event. Therefore it just copy received data into the ringbuffer and setup the write watcher.

In the directory step2 you can find almost the same application, but it is forwarding incoming message to couchbase server and reply its CAS value back to the client. The interesting thing here, that libcouchbase could be used without any event library dependency, because the host server application already has builtin event loop.

For second example libcouchbase version 2.0.0+ needed. See http://www.couchbase.com/develop/c/current for installation details.

To build examples use simple command sequence:

$ ./autogen.sh && ./configure && make

About

Example of integration libev application with couchbase

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages