You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Introduce support for persistent metadata watches (#1145)
* Introduce support for persistent metadata watches
The `watch` (and `watch_metadata` respectively) functions on the Api
type are fallible, and watches are not recovered. Errors may happen for
any reason, such as network induced errors, restarts (etcd can only
cache so many resourve versions), and so on. To get around these
failures, we have a `watcher()` utility in the runtime crate that
manages the underlying stream in a persistent way, recovering on
failure.
This change introduces support for persistent metadata watches, through
a `metadata_watcher` function in the same crate. Watches may be
established on any type of resources, the main difference is that the
returned types no longer correspond to the type of the Api. Instead,
a concrete metadata type is returned.
To support this with no breaking changes and to allow for more maintable
code, a few utility functions and traits are introduced in the `runtime`
crate.
Signed-off-by: Matei David <matei@buoyant.io>
* Run clippy
Signed-off-by: Matei David <matei@buoyant.io>
* Make closure arg generic
Signed-off-by: Matei David <matei@buoyant.io>
* Fix doc test
Signed-off-by: Matei David <matei@buoyant.io>
* Bump MSRV to 1.63.0
Signed-off-by: Matei David <matei@buoyant.io>
* Rename AsyncFn to StepFn
Signed-off-by: Matei David <matei@buoyant.io>
* Add a compile-time typecheck and a meta example to dynamic watcher
Signed-off-by: Matei David <matei@buoyant.io>
* Rename watch_metadata to metadata_watcher and allow module rep
Signed-off-by: Matei David <matei@buoyant.io>
* Add trait to specialize Api calls instead of relying on closures
Signed-off-by: Matei David <matei@buoyant.io>
* Change meta watcher fn name in example
Signed-off-by: Matei David <matei@buoyant.io>
* Parse evar as 1
Signed-off-by: Matei David <matei@buoyant.io>
* Refactor dynamic_watcher example
Signed-off-by: Matei David <matei@buoyant.io>
---------
Signed-off-by: Matei David <matei@buoyant.io>
0 commit comments