Skip to content

use FuturesUnordered instead of embassy_futures::join #862

Description

@tommasoclini

Hi,

I noticed that to run multiple things at once embassy_futures::join is being used, I have a similar use case where I have replaced it with FuturesUnordered from futures-rs and this avoids polling every future every time, kind of like if they were separate tasks(I did this after noticing that all of my futures were being pulled like 1000 times per second).

It uses an Arc backed linked list, but allocations are made only when setting up the futures, not while running them. I have a fork of futures-rs in my profile that optionally uses portable-atomic and portable-atomic-util types, so archs without atomics are not a problem.

I know it is a bit experimental, but I wanted to know if you would like to give it a try, right now I don't have hardware to test on, but if you do want to try it I'll modify an example for you to test it.

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