BoundSessionRequest
yosoi.request.BoundSessionRequest
class BoundSessionRequest:
A page request retaining a caller-owned browser Session or Work.
Attributes: request: Authored or policy-bound page request to send through the retained owner.
Source: python/yosoi/request.py:429
Members below are declared on this class. Inherited Pydantic methods and generated constructor signatures are not expanded.
Fields and class attributes
Section titled “Fields and class attributes”request: PageRequest | BoundPageRequest
Methods
Section titled “Methods”def __init__(self, request: PageRequest | BoundPageRequest, *, session: Session | None=None, work: Work | None=None) -> None:
Retain exactly one caller-owned browser execution owner.
Args: request: Authored or policy-bound acquisition request. session: Browser Session to reuse, mutually exclusive with work. work: Browser Work lease to reuse, mutually exclusive with session.
Raises: TypeError: Both or neither owners are supplied, or an owner has the wrong type.
The caller controls the owner’s lifetime. Construction starts no acquisition and does not transfer responsibility for closing the Session or Work lease.
Source: python/yosoi/request.py:441
@property
def id(self) -> RequestId:
Return the identity of the retained authored request.
Source: python/yosoi/request.py:476
target
Section titled “target”@property
def target(self) -> WebTarget:
Return original target text, which can contain user-sensitive data.
Source: python/yosoi/request.py:481
policy
Section titled “policy”@property
def policy(self) -> Policy | None:
Return a policy copy when explicitly bound, otherwise None.
Source: python/yosoi/request.py:486
async def send(self, *, cancellation: CancellationToken | None=None) -> Response:
Acquire documents through the retained Session or Work owner.
Args: cancellation: Optional cooperative token. When omitted, the owner applies its existing cancellation behavior. Observed cancellation preserves completed outcomes and does not undo external effects.
Returns: A typed response without closing the Session or releasing the Work lease. Inspect individual attempts rather than treating completion as success.
Raises: BrowserError: The Session has not been entered or Work is unavailable. RequestError: Request preparation or acquisition setup cannot begin. RuntimeError: The binding has lost both execution owners.