Get the current :class:`Connection`
()
| 94 | |
| 95 | |
| 96 | def 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 | |
| 105 | def _setup_common_routes( |
no outgoing calls
no test coverage detected