cadrumo.adapters.outbound.aeat.auth.browser_lifecycle module

Shared browser lifecycle primitives for AEAT authentication providers.

class CloseIntentBarrier[source]

Bases: object

Serialize closers and bar new work while any close intent exists.

property closing: bool

Return whether one or more close callers are registered.

property close_intents: int

Return the number of registered close callers.

work()[source]

Enter ordinary work only when every registered closer has exited.

Return type:

AsyncGenerator[None]

close()[source]

Register one close intent and serialize its teardown sequence.

Return type:

AsyncGenerator[None]

async close_owned_browser_context(context, *, timeout_ms, logger, owner)[source]

Close an owned browser context within timeout_ms and report completion.

Return type:

bool

Parameters:
async close_owned_browser_session(session, *, timeout_ms, logger, owner)[source]

Close an owned browser session within timeout_ms.

Returns True when no session exists or teardown completes. A timeout or close failure is logged and returns False so the provider retains the session reference and a later close() call can retry.

Return type:

bool

Parameters: