Reloadable
Constructors
Signature
declare const auto: <I, S, E, In, R>(
tag: Context.Tag<I, S>,
options: {
readonly layer: Layer.Layer<I, E, In>;
readonly schedule: Schedule.Schedule<unknown, unknown, R>;
},
) => Layer.Layer<Reloadable<I>, E, R | In>;autoFromConfig
Added in v2.0.0
Source
Makes a new reloadable service from a layer that describes the construction of a static service. The service is automatically reloaded according to a schedule, which is extracted from the input to the layer.
Signature
declare const autoFromConfig: <I, S, E, In, R>(
tag: Context.Tag<I, S>,
options: {
readonly layer: Layer.Layer<I, E, In>;
readonly scheduleFromConfig: (
context: Context.Context<In>,
) => Schedule.Schedule<unknown, unknown, R>;
},
) => Layer.Layer<Reloadable<I>, E, R | In>;Makes a new reloadable service from a layer that describes the construction of a static service.
Signature
declare const manual: <I, S, In, E>(
tag: Context.Tag<I, S>,
options: {
readonly layer: Layer.Layer<I, E, In>;
},
) => Layer.Layer<Reloadable<I>, E, In>;Reloads the specified service.
Signature
declare const reload: <I, S>(tag: Context.Tag<I, S>) => Effect.Effect<void, unknown, Reloadable<I>>;reloadFork
Added in v2.0.0
Source
Forks the reload of the service in the background, ignoring any errors.
Signature
declare const reloadFork: <I, S>(
tag: Context.Tag<I, S>,
) => Effect.Effect<void, unknown, Reloadable<I>>;Context
Getters
Models
Reloadable interface
Added in v2.0.0
Source
A Reloadable is an implementation of some service that can be dynamically reloaded, or swapped out for another implementation on-the-fly.
Signature
interface Reloadable<in out A> extends Variance<A> {}Other
Reloadable
Added in v2.0.0
Source
Symbols
ReloadableTypeId
Added in v2.0.0
Source
Signature
declare const ReloadableTypeId: unique symbol;ReloadableTypeId type
Added in v2.0.0
Source
Signature
type ReloadableTypeId = typeof ReloadableTypeId;
Makes a new reloadable service from a layer that describes the construction of a static service. The service is automatically reloaded according to the provided schedule.