Uploaded image for project: 'C++ Couchbase Client'
  1. C++ Couchbase Client
  2. CXXCBC-381

Use shared pointers for transaction attempt object

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • 1.0.0
    • None
    • transactions

    Description

      Callback-based (bulk or async) API cannot rely on C++ references, because it is executed asynchronously.

      We might want to allow the pointer to attempt object to survive the logic lambda, so that the following code will be possible

      txn.run([](auto attempt)  {
          attempt.get([attempt] (auto ctx, auto res) {
            if(ctx.ec()) {
              // handle error
            } else {
              attempt.replace(...)
            }
          });
      });
      

       

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            avsej Sergey Avseyev
            avsej Sergey Avseyev
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes