Skip to content

Make CodecContext.decode non-blocking? #2261

@oakaigh

Description

@oakaigh

Currently, CodecContext.decode blocks until the packet is fully decoded; For containers with multiple streams, this isn't ideal because streams can be decoded in parallel.

It would be useful if CodecContext.send_packet and CodecContext.recv_frame are available - or better, CodecContext.decode_async, which returns a concurrent.futures.Future. The underlying implementation is already async so adding support is trivial. The current (and obvious) workaround is to create the CodecContext in another thread but that's just unnecessary.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions