The resq.http surface¶
resq.http is the aggregated HTTP-core surface of resq. It exists for consumers who
need a type that the top-level resq package does not re-export — the response wrappers
or the polling routine — or who prefer a single import location for the whole surface.
resq.http is an aggregation point: it re-exports the public names of its submodules
and adds no logic of its own.
from resq.http import Requests, Session # clients
from resq.http import Response, AsyncResponse # response wrappers
from resq.http import BaseResponse # common ancestor (typing only)
from resq.http import poll # polling routine (sync or async by wrapper)
When to import from resq.http vs resq¶
The top-level resq package re-exports only the two clients:
Reach for resq.http only when you need a type beyond those two clients:
- The response wrappers —
Response,AsyncResponse— to annotate a variable that holds a client result, or to callreloadagainst a typed reference. pollto drive a polling loop directly over a pre-built wrapper.BaseResponsefor code that must accept both the sync and async wrapper uniformly.
Behavior & preconditions¶
resq.httpre-exports names; it owns no behavior. Construction, request semantics, polling, and reload live in the underlying modules.- Clients take the
adapterargument ('requests'/'httpx') selecting sync vs async mode; one instance = one mode. pollis one routine; its mode is fixed by the wrapper's type.reloadis one name on both wrappers (await it onAsyncResponse).BaseResponseis the common ancestor and is not constructed directly — you always receive aResponseorAsyncResponsefrom a client verb.