Skip to content
This repository has been archived by the owner on Aug 11, 2020. It is now read-only.

Message Life Cycle

Rick Zhou edited this page Oct 26, 2017 · 1 revision

Life cycle of request message

requester:

  • create a request message
  • send the message via session->requester->subscribe/list/set/invoke
  • requester generate a requester stream object, assign an rid to the stream, and put it in a map that has the rid as key
  • session put stream in queue until the connection is ready to write
  • session get the first message from the stream and write it to connection -it's possible multiple request is made before stream start to write, in some case the message will be sent one by one( like invoke), some case only the last one is sent (like subscribe)

responder:

  • connection receive the message from different strand, parse it and send it to the session object (strand dispatch)
  • session check the message type, and give it to responder (because it's a request message)
  • rsponder forward this message to stream if that stream exists, or it create a stream with the rid in message
  • stream send the messsage to OutgoingStreamAcceptor ( in most case, this interface is implemented by NodeStateManager)
  • NodeStateManager find a NodeState in the tree with the requst path
  • the NodeState will check if NodeModel exists, if it exists, forward to model, otherwise hold the stream
Clone this wiki locally