Function kube_runtime::controller::applier
source · [−]pub fn applier<K, QueueStream, ReconcilerFut, T>(
reconciler: impl FnMut(Arc<K>, Context<T>) -> ReconcilerFut,
error_policy: impl FnMut(&ReconcilerFut::Error, Context<T>) -> ReconcilerAction,
context: Context<T>,
store: Store<K>,
queue: QueueStream
) -> impl Stream<Item = Result<(ObjectRef<K>, ReconcilerAction), Error<ReconcilerFut::Error, QueueStream::Error>>> where
K: Clone + Resource + 'static,
K::DynamicType: Debug + Eq + Hash + Clone + Unpin,
ReconcilerFut: TryFuture<Ok = ReconcilerAction> + Unpin,
ReconcilerFut::Error: Error + 'static,
QueueStream: TryStream,
QueueStream::Ok: Into<ReconcileRequest<K>>,
QueueStream::Error: Error + 'static,
Expand description
Apply a reconciler to an input stream, with a given retry policy
Takes a store
parameter for the core objects, which should usually be updated by a reflector
.
The queue
indicates which objects should be reconciled. For the core objects this will usually be
the reflector
(piped through trigger_self
). If your core objects own any subobjects then you
can also make them trigger reconciliations by merging the reflector
with a watcher
or reflector
for the subobject.
This is the “hard-mode” version of Controller
, which allows you some more customization
(such as triggering from arbitrary [Stream
]s), at the cost of being a bit more verbose.