Skip to content

Async-closures or reference-parameterized-closures-returning-futures #78

Open
@stuhood

Description

@stuhood

Brief summary

Not having async closures can mean needing to resort to macros to create certain (fairly common) types of combinators (ones where a closure that returns a future runs into lifetime issues).

We experienced this in pantsbuild/pants#11548, and I ended up writing a macro to put what would have been a parameter to a closure-returning-a-future or async-closure directly on the stack instead: pantsbuild/pants#11759

Optional details

  • (Optional) Which character(s) would be the best fit and why?
    • Alan: the experienced "GC'd language" developer, new to Rust
    • Grace: the systems programming expert, new to Rust
    • Niklaus: new programmer from an unconventional background
    • Barbara: the experienced Rust developer
  • (Optional) What are the key points or morals to emphasize?
    • Working reference-parameter-taking-closures-returning-futures would be great to have, but would require fairly advanced lifetimes (GATs?) to use even once they are possible (would likely be Barbara's choice). On the other hand, async-closures are less general, but likely to be easier to use (would likely be Alan's choice).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    In Progress

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions