INNER CODE UNIT · Python
_process_owned_request_thread
mars-tw/anti-gambling-trader-tw · core/ui/server.py:240
def _process_owned_request_thread(self, request: Any, client_address: Any, key: int) -> None:
# The input timer only tears down this request socket. It never writes
# user data and complements the per-read timeout configured by the
# handler. Once the request schema is validated, the handler switches
# to the longer bounded compute timer above.
with self._owned_lock:
if key in self._owned_connections and not self._owned_closing:
self._schedule_owned_deadline_locked(
key,
_REQUEST_DEADLINE_SECONDS,
)
try:
self.finish_request(request, client_address)
except Exception:
self.handle_error(request, client_address)
finally:
with self._owned_lock:
deadline = self._owned_request_deadlines.pop(key, None)