Couchbase
  • Why NoSQL?
  • Couchbase Server
  • Download
  • Resources
  • Careers
Home | Forums | SDKs | SDKs

Some Qs on libcouchbase Apis

1 reply [Last post]
  • Login or register to post comments
Mon, 04/23/2012 - 02:39
sjpark9
Offline
Joined: 03/01/2012
Groups: None

I came up with more questions ! YAY! (sorry)

1. what does "libcouchbase_set_cookie" Api do?

I can see that it sets cookie, but all of the APIs of libcouchbase has "cookie" as parameter that we can put it in. Why is there another API doing this?

Explanation of this "cookie" thing will be very helpful thank you.

2. IO_opt ... seems like setting IO option api to me... I will look in the source folder to check but any explanation on this will be helpful aswell since I couldn't get any info on the couchbase website

Top
  • Login or register to post comments
Mon, 05/21/2012 - 02:08
avsej
avsej's picture
Offline
Joined: 06/15/2011
Groups: None

sjpark9 wrote:

1. what does "libcouchbase_set_cookie" Api do?

I can see that it sets cookie, but all of the APIs of libcouchbase has "cookie" as parameter that we can put it in. Why is there another API doing this?

You can think about "cookies" as context parameter, the libcouchbase doesn't make any assumptions about this context. There are two types of cookies in libcouchbase:

1. instance cookie. could be carried per each libcouchbase_t instance using API calls libcouchbase_set_cookie()/libcouchbase_get_cookie()

2. command cookie. this cookie you are passing when you are scheduling the operation and it will be available in the appropriate callback as cookie parameter.

E.g. when you are implementing some OOP atop of libcouchbase, the cookie could carry "this" pointer.

sjpark9 wrote:

2. IO_opt ... seems like setting IO option api to me... I will look in the source folder to check but any explanation on this will be helpful aswell since I couldn't get any info on the couchbase website

The libcouchbase_io_opt_st instance encapsulating all IO operations the libcouchbase need to interact with cluster. This abstraction could be used when you are handing the event loop manually (not using libcouchbase_wait()) or if you are are going to add support for new evented framework. Currently libcouchbase support libevent (https://github.com/couchbase/libcouchbase/blob/master/src/plugin-libevent.c) and native windows routines (https://github.com/couchbase/libcouchbase/blob/master/src/plugin-win32.c).

__________________

Find me on FreeNode IRC in #libcouchbase channel

Top
  • Login or register to post comments
  • Login or register to post comments
  • Login
  • Register

Company

  • About Us
  • Leadership
  • Customers
  • Partners
  • Contact Us

Product

  • Couchbase Server
  • Couchbase SDKs
  • Use Cases
  • Documentation
  • Forums

Open Source

  • Couchbase Project
  • Couchbase vs. CouchDB

Commercial

  • Subscriptions & Support
  • Training & Services

News

  • Blog
  • Newsletter
  • Press Releases
  • Buzz

Follow Us

    
  • Customer Login
  • Terms of Service
  • Privacy Policy
  • Trademark Policy
  • Site Map

© 2013 COUCHBASE All rights reserved.

Sign in to Couchbase Community

close
  • Create new account
  • Request new password
You are logging into the Forums, Wiki and Issue Tracker