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

Change the contract of MessageHandler::process()

    XMLWordPrintableJSON

Details

    • Icon: Task Task
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • None
    • None
    • Networking
    • None
    • Fully Compatible
    • Platforms 13 (04/22/16), Platforms 14 (05/13/16), Platforms 15 (06/03/16)

    Description

      The current definition of MessageHandler::process() is as follows:

      /**
       * Called every time a message comes in. Handler is responsible for responding to client.
       */
      virtual void process(Message& m, AbstractMessagingPort* p) = 0;
      

      We would like to change this contract so that the handle does not have to know about an AbstractMessagingPort. A new method might look like this:

      using SendMessageFn = stdx::function<void(Message&, Session)>;
       
      /**
       * Called every time a message comes in.  Handler is responsible for responding to client.
       */
      virtual void process(Message& m, Session session, SendMessageFn reply) = 0;
      

      Session objects would be created in PortMessageServer::handleIncomingMessage().

      Some questions:

      • Can we do this for mongod and mongos separately?
      • What information from AbstractMessagingPort needs to go into a Session to make this work?

      Attachments

        Activity

          People

            samantha.ritter@mongodb.com Samantha Ritter (Inactive)
            samantha.ritter@mongodb.com Samantha Ritter (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: