MCPcopy Index your code
hub / github.com/reactive-python/reactpy / use_connection

Function use_connection

src/py/reactpy/reactpy/backend/sanic.py:96–102  ·  view source on GitHub ↗

Get the current :class:`Connection`

()

Source from the content-addressed store, hash-verified

94
95
96def use_connection() -> Connection[_SanicCarrier]:
97 """Get the current :class:`Connection`"""
98 conn = _use_connection()
99 if not isinstance(conn.carrier, _SanicCarrier): # nocov
100 msg = f"Connection has unexpected carrier {conn.carrier}. Are you running with a Sanic server?"
101 raise TypeError(msg)
102 return conn
103
104
105def _setup_common_routes(

Callers 2

use_requestFunction · 0.70
use_websocketFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected