← Về thư mục
openai4s/orchestration/worker_gateway.py
- Registration · class · L73-L95 — class Registration
- parse_listen · function · L98-L117 — def parse_listen(spec: str | None) -> tuple[str, int] | None
- _enable_keepalive · function · L120-L143 — def _enable_keepalive(conn: socket.socket) -> None
- WorkerGateway · class · L146-L645 — class WorkerGateway
- init · method · L149-L186 — def init( self, authority: BootstrapAuthority, *, bind: tuple[str, int], on_register: Callable[[Registration], None] | None = None, interrupt_hook_for: Callable[[str], Callable[[], bool]] | None = None, max_pending_handshakes: int = MAX_PENDING_HANDSHAKES, ) -> None
- address · method · L191-L192 — def address(self) -> tuple[str, int] | None
- set_registration_expectation · method · L194-L199 — def set_registration_expectation( self, predicate: Callable[[str, int], bool] | None ) -> None
- start · method · L201-L216 — def start(self) -> None
- stop · method · L218-L255 — def stop(self, *, timeout_s: float = 5.0) -> None
- _serve · method · L257-L309 — def _serve(self) -> None
- _handshake_bounded · method · L311-L326 — def _handshake_bounded( self, conn: socket.socket, addr: Any, generation: int ) -> None
- _handshake · method · L330-L451 — def _handshake( self, conn: socket.socket, addr: Any, *, gateway_generation: int | None = None ) -> None
- _read_handshake_line · method · L454-L480 — def _read_handshake_line(conn: socket.socket, deadline: float) -> str
- _reap_locked · method · L482-L542 — def _reap_locked(self) -> int
- _note_rejection · method · L544-L551 — def _note_rejection(self, peer: str, exc: BaseException) -> None: # stderr, not a broadcast: this is daemon-level and there is no # session it belongs to.
- await_worker · method · L555-L567 — def await_worker( self, allocation_id: str, epoch: int, *, timeout_s: float ) -> Registration | None
- await_workers · method · L569-L645 — def await_workers( self, allocation_id: str, epoch: int, *, expected: int, timeout_s: float ) -> list[Registration]
- gateway_from_environment · function · L648-L655 — def gateway_from_environment( authority: BootstrapAuthority, **kwargs: Any ) -> WorkerGateway | None