MCPcopy
hub / github.com/XX-net/XX-Net / queueMessage

Method queueMessage

code/default/lib/noarch/tlslite/messagesocket.py:132–156  ·  view source on GitHub ↗

Queue message for sending If the message is of same type as messages in queue, the message is just added to queue. If the message is of different type as messages in queue, the queue is flushed and then the message is queued. :rtype: generator

(self, msg)

Source from the content-addressed store, hash-verified

130 pass
131
132 def queueMessage(self, msg):
133 """
134 Queue message for sending
135
136 If the message is of same type as messages in queue, the message is
137 just added to queue.
138
139 If the message is of different type as messages in queue, the queue is
140 flushed and then the message is queued.
141
142 :rtype: generator
143 """
144 if self._sendBufferType is None:
145 self._sendBufferType = msg.contentType
146
147 if msg.contentType == self._sendBufferType:
148 self._sendBuffer += msg.write()
149 return
150
151 for res in self.flush():
152 yield res
153
154 assert self._sendBufferType is None
155 self._sendBufferType = msg.contentType
156 self._sendBuffer += msg.write()
157
158 def queueMessageBlocking(self, msg):
159 """Blocking variant of :py:meth:`queueMessage`."""

Callers 2

queueMessageBlockingMethod · 0.95
sendMessageMethod · 0.95

Calls 2

flushMethod · 0.95
writeMethod · 0.45

Tested by

no test coverage detected