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

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

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Service Arch

      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()

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

              Created:
              Updated: