[SERVER-23755] Change the contract of MessageHandler::process() Created: 15/Apr/16  Updated: 22/May/16  Resolved: 20/May/16

Status: Closed
Project: Core Server
Component/s: Networking
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Major - P3
Reporter: Samantha Ritter (Inactive) Assignee: Samantha Ritter (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-23756 Change the definition of MessageHandl... Closed
Backwards Compatibility: Fully Compatible
Sprint: Platforms 13 (04/22/16), Platforms 14 (05/13/16), Platforms 15 (06/03/16)
Participants:

 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?


 Comments   
Comment by Samantha Ritter (Inactive) [ 20/May/16 ]

The work being done for SERVER-24162 makes this ticket unnecessary.

Generated at Thu Feb 08 04:04:23 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.