Skip to content

Send data in a thread #349

@davidbrochart

Description

@davidbrochart

When sending a message here:

data = self.connection.send(event)

data can be compressed and it can be CPU-intensive depending on the size of the data. Do you think this call could be wrapped in a thread? There would need to be a backend-specific abstraction, but for instance for asyncio it would be equivalent to:

data = await asyncio.to_thread(self.connection.send, event)

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