Skip to content

Consider adding asynchronous analogues of web_hacker/cdp/ classes #55

@alex-w-99

Description

@alex-w-99

web-hacker works successfully in standalone scripts, but I recently needed to integrate its monitoring capabilities (specifically the logic within cdp/) into a high-concurrency FastAPI server.

Because the current implementation relies on synchronous libraries (websocket-client, threading.Condition) and blocking I/O, it is difficult to use directly within an asyncio event loop (e.g., websockets or aiohttp) without blocking the main thread or wrapping everything in thread executors.

It would be useful to have "async" equivalents of the core monitors, such as AsyncNetworkMonitor, AsyncStorageMonitor, etc., that decouple the business logic from the transport layer. That would involve:

  • Transport abstraction to allow monitors to accept a generic send_command callback (returning an Awaitable) rather than a specific synchronous websocket instance.
  • Async class analogues, Async versions of the monitors that use async/await for message handling and command execution.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions