There are a number of ways to achieve this. We want this timeout to be a property of the health obsever so that individual observers can adjust it based on their use case. Below is an example:
- Define the timeout period for a single health check as a property of health observers.
- Define a type that takes a Future and timeout value as input, and returns a Future as output such that the returned Future is satisfied when the timeout period has expired or the input future is satisfied. Whichever comes first.
- Wrap the future here with this new type.