# feature_flags: Add \`FeatureFlagAppExt::wait_for_flag_or_timeout\` \(\#24055\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/4d9659adc4f4704c8a80411b22d2036d1b9e30fe)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 4d9659adc4f4704c8a80411b22d2036d1b9e30fe

Requested commit: 4d9659adc4f4704c8a80411b22d2036d1b9e30fe

Commit: 4d9659adc4f4704c8a80411b22d2036d1b9e30fe

Tree: c0cf195dac96231770f86a6e3786d0adec72bdf8

Author: Marshall Bowers

Committer: GitHub

## Message

```
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
```

## Parents

- [3af37ddf6d5f5156f4cbc874832265aee0532009](https://git.cafe/gitcafe/zed/commit/3af37ddf6d5f5156f4cbc874832265aee0532009?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/4d9659adc4f4704c8a80411b22d2036d1b9e30fe?format=markdown)
