Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-35026

Add types for the Reader and Writer halves of the ProducerConsumerQueue

    XMLWordPrintable

Details

    Description

      The ProducerConsumerQueue in util is meant to be used by separate threads for reading and writing.  It would be useful if it had specific types for those operations, which would statically enforce the correct usage of the type.

      A helper method would probably look something like:

      auto [producer, consumer] = makeProducerConsumerQueueHalves(...);
      

      which would create the queue with make_shared, and construct each half with a shared ref.

      The halves would each own the half of the api they use. On destruction, they'd call their associated close.

      Attachments

        Issue Links

          Activity

            People

              backlog-server-platform DO NOT USE - Backlog - Platform Team
              jason.carey@mongodb.com Jason Carey
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: