# sync_protocol

URL: /pounce/api/sync_protocol/
Section: api
Description: SyncApp protocol — fused sync request-response path for Pounce.

When a SyncApp is provided, the sync worker calls handle_sync() first.
If it returns a RawResponse, the request is served without asyncio,
ASGI scope, or Request/Response object construction. If it returns None,
the request falls through to the full ASGI path (streaming, WebSocket, etc.).

---

> For a complete page index, fetch /pounce/llms.txt.

Open LLM text
(/pounce/api/sync_protocol/index.txt)

Share with AI

Ask Claude
(https://claude.ai/new?q=Please%20help%20me%20understand%20this%20documentation%3A%20%2Fpounce%2Fapi%2Fsync_protocol%2Findex.txt)

Ask ChatGPT
(https://chatgpt.com/?q=Please%20help%20me%20understand%20this%20documentation%3A%20%2Fpounce%2Fapi%2Fsync_protocol%2Findex.txt)

Ask Gemini
(https://gemini.google.com/app?q=Please%20help%20me%20understand%20this%20documentation%3A%20%2Fpounce%2Fapi%2Fsync_protocol%2Findex.txt)

Ask Copilot
(https://copilot.microsoft.com/?q=Please%20help%20me%20understand%20this%20documentation%3A%20%2Fpounce%2Fapi%2Fsync_protocol%2Findex.txt)

Module

#
`sync_protocol`

SyncApp protocol — fused sync request-response path for Pounce.

When a SyncApp is provided, the sync worker calls handle_sync() first.
If it returns a RawResponse, the request is served without asyncio,
ASGI scope, or Request/Response object construction. If it returns None,
the request falls through to the full ASGI path (streaming, WebSocket, etc.).

3Classes

## Classes

`RawRequest`

8

▼

Raw HTTP request data for the fused sync path.

Raw HTTP request data for the fused sync path.

#### Attributes

Name
Type
Description

`method`

`bytes`

HTTP method as bytes (e.g., b"GET").

`path`

`bytes`

Raw path bytes (no unquote).

`query_string`

`bytes`

Query string as bytes (e.g., b"page=1").

`headers`

`tuple[tuple[bytes, bytes], ...]`

Header pairs as a tuple of (name, value) byte pairs.

`body`

`bytes`

Request body bytes.

`client`

`tuple[str, int]`

Client (host, port) tuple.

`server`

`tuple[str, int]`

Server (host, port) tuple.

`http_version`

`str`

HTTP version string (e.g., "1.1").

`RawResponse`

3

▼

Raw HTTP response for the fused sync path.

Raw HTTP response for the fused sync path.

#### Attributes

Name
Type
Description

`status`

`int`

HTTP status code.

`headers`

`tuple[tuple[bytes, bytes], ...]`

Header pairs as a tuple of (name, value) byte pairs.

`body`

`bytes`

Response body bytes.

`SyncApp`

1

▼

Protocol for sync request-response handling.

When Pounce calls handle_sync(), returns RawResponse …

Bases:

`Protocol`

Protocol for sync request-response handling.

When Pounce calls handle_sync(), returns RawResponse for sync handling, or
None to fall through to the full ASGI path (streaming, WebSocket, etc.).

#### Methods

`handle_sync`

1

`RawResponse (/pounce/api/sync_protocol/#RawResponse) | None`

▼

Handle a single sync request.

Returns RawResponse for sync handling, or None t…

`def handle_sync(self, request: RawRequest) -> RawResponse | None`

Handle a single sync request.

Returns RawResponse for sync handling, or None to fall through to ASGI.

##### Parameters

Name
Type
Description

`request`
`—`

##### Returns

`RawResponse (/pounce/api/sync_protocol/#RawResponse) | None`
