Skip to content

Conversation

Daniel-Aaron-Bloom
Copy link

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.

This PR replaces #732

@tobz tobz added C-enhancement Category: A PR with an enhancement or a proposed on in an issue. A-buffer Area: The tower "buffer" middleware A-util Area: The tower "util" module I-needs-decision Issues in need of decision. labels Jul 20, 2024
@jplatte
Copy link
Member

jplatte commented Aug 1, 2025

As a co-maintainer, I am very hesitant about merging breaking changes. I want to leave this up to people who have been involved with the project more (unfortunately that probably means there won't be a decision here for a long time).

@seanmonstar
Copy link
Collaborator

That's what I kind of thought when looking at this too, it's a breaking change. We could consider it for the next major release, but I don't know when that is.

@ripytide
Copy link
Contributor

ripytide commented Aug 1, 2025

It's good progress at least though if you maintainers are happy with the change given the requirement that it is merged as part of the next major breaking release and not merged until then.

@Daniel-Aaron-Bloom
Copy link
Author

Are there any labels that could be applied to this PR to ensure it doesn't get forgotten in vNext?

@jplatte jplatte added this to the v0.6 milestone Aug 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-buffer Area: The tower "buffer" middleware A-util Area: The tower "util" module C-enhancement Category: A PR with an enhancement or a proposed on in an issue. I-needs-decision Issues in need of decision.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants