MCPcopy
hub / github.com/plotly/dash / _queue_message

Method _queue_message

dash/backends/ws.py:100–110  ·  view source on GitHub ↗

Serialize and queue message for sending (thread-safe, non-blocking). Uses to_json for proper serialization of Dash components. Does nothing if the connection has been shut down.

(self, msg: dict)

Source from the content-addressed store, hash-verified

98 return self._pending_get_props
99
100 def _queue_message(self, msg: dict) -> None:
101 """Serialize and queue message for sending (thread-safe, non-blocking).
102
103 Uses to_json for proper serialization of Dash components.
104 Does nothing if the connection has been shut down.
105 """
106 if self.is_shutdown:
107 return
108 outbound_queue = self._get_outbound_queue()
109 if outbound_queue is not None:
110 outbound_queue.sync_q.put_nowait(cast(str, to_json(msg)))
111
112 async def set_prop(self, component_id: str, prop_name: str, value: Any) -> None:
113 """Send immediate prop update to the client via WebSocket.

Callers 2

set_propMethod · 0.95
get_propMethod · 0.95

Calls 2

_get_outbound_queueMethod · 0.95
to_jsonFunction · 0.90

Tested by

no test coverage detected