Details

    • Type: Technical task
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.0beta2
    • Fix Version/s: 2.4.0-dp1
    • Component/s: library
    • Security Level: Public
    • Labels:
      None

      Description

      There's quite a bit of user code which calls io->run_event_loop and io->stop_event_loop.

      These functions are largely private and are intended for use by libcouchbase itself. The fact that they are public API is only accidental, due to the fact that they are part of the iops structure.

      These functions should never be called by user code:

      1) They are a source of confusion (especially when mixed with lcb_wait)
      2) They prevent any kind of wrapping/sanity logic done by lcb_wait (some already exists, and some can be implemented in future versions)

      The following should be done

      1) Remove the iops structure definition from being included by the main header file. Thus, #include <libcouchbase/couchbase.h> should not allow a dereference of the iops structure. Rather the iops structure should be defined in a new header file (iops.h) - so that users who want to explicitly manipulate and write event loop plugins can include it, but should otherwise not be present in 'user' code. types.h should include a predeclaration of the structure so that it may still be passed around as a simple pointer value.

      2) Document the purpose of run_event_loop/stop_event_loop. Make it very clear that lcb_wait should be used in all synchronous use cases. If we have any examples using run_event_loop/stop_event_loop, remove them.

      3) [ Optional? ] - In order to further discourage users from using these functions, throw a compiler warning/error for those functions unless LIBCOUCHBASE_INTERNAL is defined - tbd

        Issue Links

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

          Activity

          Hide
          mnunberg Mark Nunberg added a comment -

          This is private. Depending on the plugin implementation, run_event_loop/stop_event_loop will crash or do random things. Don't use it anymore

          Show
          mnunberg Mark Nunberg added a comment - This is private. Depending on the plugin implementation, run_event_loop/stop_event_loop will crash or do random things. Don't use it anymore

            People

            • Assignee:
              mnunberg Mark Nunberg
              Reporter:
              mnunberg Mark Nunberg
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Gerrit Reviews

                There are no open Gerrit changes