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

Simplify the Session read/write Interfaces to be sync/async agnostic

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Major - P3 Major - P3
    • None
    • None
    • None
    • None
    • Service Arch

    Description

      As it stands today, both ingress and egress code paths use the same Session abstraction to implement their respective sides of sending or receiving commands. To accommodate this, the Session API provides 6 functions to enable sync and async interactions:

      • StatusWith<Message> sourceMessage()
      • Future<Message> asyncSourceMessage(const BatonHandle& handle)
      • Status waitForData()
      • Future<void> asyncWaitForData()
      • Status sinkMessage(Message message)
      • Future<void> asyncSinkMessage(Message message, const BatonHandle& handle)

       

      Follow the pattern established by the refactor of the SessionWorkflow (formerly ServiceStateMachine) and use Future to provide an async-agnostic API to callers instead:

      • Future<Message> receiveMessage(PollingCoordinator& pc)
      • Future<void> sendMessage(PollingCoordinator& pc, const Message& msg)
      • Future<void> whenDataReady()

      Attachments

        Activity

          People

            backlog-server-servicearch Backlog - Service Architecture
            matt.diener@mongodb.com Matt Diener (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: