2013-06-06 13:18 阅读 73

如何在Couchbase PHP客户端库中进行异步设置

In the Couchbase PHP client library there is a exposed method called getDelayed that accept a callback as a parameter and allows you to do a asynchronous get to couchbase.

The problem is that I can't find any method to do a asynchronous set (I'm expecting something like setDelayed).

Anyone know a way to do this? What can be the reason to implement a asynchronous get and not a set?

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

2条回答 默认 最新

  • 已采纳
    dongmaqiu6084 dongmaqiu6084 2013-06-11 07:25

    The Couchbase client library does not provide asynchronous methods for set/update operations.

    点赞 评论 复制链接分享
  • dras2334 dras2334 2013-06-08 04:53

    I'm wondering what the purpose would be ... the async get makes sense ... you send a bunch of keys and get a response whenever the data is sent back to you. With a set you're going to send the data to the server. The couch server will cache the data in memory and return instantly. My understanding is that it queues it for disk writing. After writing to disk it queues it for indexing of views. There really isn't much to "delay". It returns to you immediately after writing it to memory. There isn't anything to do asynchronously is there? The only thing I could think of is the driver could cache it for you before sending it the couch server, but I'm not sure that would accomplish much except for using memory in the couch client (harder to debug oom errors).

    点赞 评论 复制链接分享