feature_flags: Add FeatureFlagAppExt::wait_for_flag_or_timeout (#24055)

This PR adds a new `wait_for_flag_or_timeout` method to the
`FeatureFlagAppExt` trait.

This encapsulates the somewhat gnarly code for using `wait_for_flag`
with a timeout.

A side benefit of this is that the tasks waiting on the feature flags
run in parallel, so in the case where the feature flags do not resolve
we don't end up having to wait on consecutive timeouts. This should help
a bit with https://github.com/zed-industries/zed/issues/23922.

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers
2025-01-31 22:35:23 +00:00
committed by GitHub
parent 3af37ddf6d
commit 4d9659adc4
4 changed files with 32 additions and 24 deletions
Generated
+1
View File
@@ -4547,6 +4547,7 @@ version = "0.1.0"
dependencies = [
"futures 0.3.31",
"gpui",
"smol",
]
[[package]]