Skip to content

Reuse inner if possible? #15

Open
Open
@wangjia184

Description

@wangjia184

I have a use case, within each second, thousands of oneshot channels are created and signaled, and then dropped.

I am thinking about if they can be reused somehow.

For each oneshot there is a new Inner allocated Arc::new(Inner::new()) on heap.
https://github.com/irrustible/async-oneshot/blob/main/src/lib.rs#L21

Can we somehow reuse the Inner in order to reduce heap allocation? Say if it is received, the Inner can be reset and used to create another pair of tx and rx?

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