Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Send data in a thread #349

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)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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