Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: enable non-'static where possible #732

Closed

Conversation

Daniel-Bloom-dfinity
Copy link

@Daniel-Bloom-dfinity Daniel-Bloom-dfinity commented May 2, 2023

Motivation

Currently, many tower service wrappers and layers are limited to working with 'static types, which limits its usefulness when working with non-statically borrowed things to and from scoped tasks (e.g. async-scoped).

Solution

Remove the 'static restrictions where possible, mostly by introducing lifetime parameters.

This change excludes Buffer and BufferLayer which are more difficult to make non-'static. It is possible to do by abstracting tokio::spawn into a trait (which async_scoped::Scope can also implement), this is also pending the publish of the recently merged tokio-rs/tokio#5665.

Copy link
Contributor

@GlenDC GlenDC left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a welcome change, but it is breaking, no? So probably has to wait for a next minor version updatae?

@Daniel-Aaron-Bloom
Copy link

@GlenDC Yes, it is mildly breaking, so probably has to wait for a minor version. Also I have lost access to the account which made this PR, so you can close it in favor of #765

@tobz
Copy link
Member

tobz commented Jul 20, 2024

Closing in favor in #765.

@tobz tobz closed this Jul 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants