Module Controller.MakeSource

Parameters

Signature

Sourcemodule Cache : sig ... end
Sourcemodule Cached : sig ... end
Sourcetype request = {
  1. key : Core.Object_key.t;
  2. resource : Resource.t option;
  3. reader : Cached.t;
  4. cancel : Cancel.t;
}
Sourcetype source
Sourcemodule Watches (Watched : Core.Resource) : sig ... end
Sourcemodule Owns (Owned : Core.Resource) : sig ... end
Sourceval component : ?cache:Cache.t -> ?namespace:string -> ?namespaces:string list -> ?label_selector:string -> ?field_selector:string -> ?watches:source list -> ?predicate:(Cache.event -> bool) -> ?name:string -> ?workers:int -> ?metrics:Metrics.t -> ?health:Health.t -> ?cache_sync_timeout:float -> ?reconcile_timeout:float -> ?error_policy:error_policy -> reconcile:(Client.t -> request -> (reconcile_result, string) result) -> unit -> Manager.component

Build a composable manager component. The primary cache and all watched caches synchronize before workers start, with a 120-second default cache_sync_timeout. reconcile_timeout, when supplied, gives every invocation a linked child cancellation token and classifies expiry as a retryable reconciliation error. Timeouts are cooperative: reconcilers must pass the request token to blocking work. namespaces selects an explicit set of namespaced streams and is mutually exclusive with namespace. health registers a readiness check named <controller>/cache-sync. It succeeds only after every cache has synchronized, initial keys are seeded, and all workers have started; cancellation and shutdown make it fail.

Sourceval run : ?cancel:Cancel.t -> ?cache:Cache.t -> ?namespace:string -> ?namespaces:string list -> ?label_selector:string -> ?field_selector:string -> ?watches:source list -> ?predicate:(Cache.event -> bool) -> ?name:string -> ?workers:int -> ?metrics:Metrics.t -> ?health:Health.t -> ?cache_sync_timeout:float -> ?reconcile_timeout:float -> ?error_policy:error_policy -> Client.t -> reconcile:(Client.t -> request -> (reconcile_result, string) result) -> (unit, Client.error) result

Standalone convenience wrapper around component and a one-controller manager. A 410 response atomically resets the shared local cache from a new LIST.