Skip to content

Best practices for combinators with their own task pools (a la FuturesUnordered) #2053

Open
@cramertj

Description

@cramertj

See #2047. When a combinator keeps its own task pool rather than deferring directly to the parent executor, cooperatively yielding (cx.waker.wake_by_ref(); return Poll::Pending) works "less well" because the task pool will remain active and thus be polled again. #2049 introduced a mitigation for this by limiting the number of times a FuturesUnordered is polled, but it'd be good to develop general guidance for these types of combinators, and perhaps a more principled solution for FuturesUnordered.

cc @jonhoo @carllerche

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