<
Self,
F extends CustomQueueItemFields = CustomQueueItemFields,
E = never,
R = never,
RR = never
>(
tag: HyperlinkTag<Self, CustomQueueInstanceSpec<F>>,
patch: ConfigPatch<
CustomQueueLayerConfig<Schema.Struct<F>["Type"], E, R, RR>
>
): Layer.Layer<never>export const const configure: <
Self,
F extends CustomQueueItemFields = CustomQueueItemFields,
E = never,
R = never,
RR = never
>(
tag: HyperlinkTag<
Self,
CustomQueueInstanceSpec<F>
>,
patch: ConfigPatch<
CustomQueueLayerConfig<
Schema.Struct<F>["Type"],
E,
R,
RR
>
>
) => Layer.Layer<never>
configure = <
function (type parameter) Self in <Self, F extends CustomQueueItemFields = CustomQueueItemFields, E = never, R = never, RR = never>(tag: HyperlinkTag<Self, CustomQueueInstanceSpec<F>>, patch: ConfigPatch<CustomQueueLayerConfig<Schema.Struct<F>["Type"], E, R, RR>>): Layer.Layer<never>Self,
function (type parameter) F in <Self, F extends CustomQueueItemFields = CustomQueueItemFields, E = never, R = never, RR = never>(tag: HyperlinkTag<Self, CustomQueueInstanceSpec<F>>, patch: ConfigPatch<CustomQueueLayerConfig<Schema.Struct<F>["Type"], E, R, RR>>): Layer.Layer<never>F extends type CustomQueueItemFields = {
[x: string]: Schema.Codec<
unknown,
unknown,
never,
never
>
}
CustomQueueItemFields = type CustomQueueItemFields = {
[x: string]: Schema.Codec<
unknown,
unknown,
never,
never
>
}
CustomQueueItemFields,
function (type parameter) E in <Self, F extends CustomQueueItemFields = CustomQueueItemFields, E = never, R = never, RR = never>(tag: HyperlinkTag<Self, CustomQueueInstanceSpec<F>>, patch: ConfigPatch<CustomQueueLayerConfig<Schema.Struct<F>["Type"], E, R, RR>>): Layer.Layer<never>E = never,
function (type parameter) R in <Self, F extends CustomQueueItemFields = CustomQueueItemFields, E = never, R = never, RR = never>(tag: HyperlinkTag<Self, CustomQueueInstanceSpec<F>>, patch: ConfigPatch<CustomQueueLayerConfig<Schema.Struct<F>["Type"], E, R, RR>>): Layer.Layer<never>R = never,
function (type parameter) RR in <Self, F extends CustomQueueItemFields = CustomQueueItemFields, E = never, R = never, RR = never>(tag: HyperlinkTag<Self, CustomQueueInstanceSpec<F>>, patch: ConfigPatch<CustomQueueLayerConfig<Schema.Struct<F>["Type"], E, R, RR>>): Layer.Layer<never>RR = never,
>(
tag: HyperlinkTag<
Self,
CustomQueueInstanceSpec<F>
>
tag: import HyperlinkTagHyperlinkTag<function (type parameter) Self in <Self, F extends CustomQueueItemFields = CustomQueueItemFields, E = never, R = never, RR = never>(tag: HyperlinkTag<Self, CustomQueueInstanceSpec<F>>, patch: ConfigPatch<CustomQueueLayerConfig<Schema.Struct<F>["Type"], E, R, RR>>): Layer.Layer<never>Self, type CustomQueueInstanceSpec<
F extends Schema.Struct.Fields
> = Omit<
{
add: any
enqueue: any
release: any
releaseEncoded: any
deadLetter: any
drop: any
events: any
status: any
size: any
isEmpty: any
levelSizes: any
start: any
pause: any
resume: any
shutdown: any
clear: any
metrics: {
stream: any
query: any
}
},
"add"
> & {
readonly add: CustomQueueAddMethod
}
Full custom-queue instance contract for itemSchema F.
CustomQueueInstanceSpec<function (type parameter) F in <Self, F extends CustomQueueItemFields = CustomQueueItemFields, E = never, R = never, RR = never>(tag: HyperlinkTag<Self, CustomQueueInstanceSpec<F>>, patch: ConfigPatch<CustomQueueLayerConfig<Schema.Struct<F>["Type"], E, R, RR>>): Layer.Layer<never>F>>,
patch: ConfigPatch<
CustomQueueLayerConfig<
Schema.Struct<F>["Type"],
E,
R,
RR
>
>
patch: import ConfigPatchConfigPatch<type CustomQueueLayerConfig<
A,
E,
R,
RR = never
> = Omit<
CustomQueueHyperlinkConfigWithItemSchema<
A,
E,
R
>,
"itemSchema" | "refill" | "name"
> & {
readonly refill?: {
readonly onStart?: boolean
readonly onDrained?: boolean
readonly load: (
queue: CustomQueueHandle<
A,
E,
QueueEnqueueErrors,
never
>
) => Effect.Effect<void, never, RR>
}
}
Worker/layer config for a toolkit custom queue (tag carries itemSchema).
CustomQueueLayerConfig<import SchemaSchema.interface Struct<Fields extends Schema.Struct.Fields>Defines a struct schema from a map of field schemas.
Details
Each field value is a schema. Use
optionalKey
or
optional
to
mark fields as optional, and
mutableKey
to mark them as mutable.
The resulting schema's Type is a readonly object type with the fields'
decoded types. The Encoded form mirrors the field schemas' encoded types.
Example (Defining a basic struct)
import { Schema } from "effect"
const Person = Schema.Struct({
name: Schema.String,
age: Schema.Number,
email: Schema.optionalKey(Schema.String)
})
// { readonly name: string; readonly age: number; readonly email?: string }
type Person = typeof Person.Type
const alice = Schema.decodeUnknownSync(Person)({ name: "Alice", age: 30 })
console.log(alice)
// { name: 'Alice', age: 30 }
Namespace for struct field type utilities.
Details
These types compute the decoded Type, encoded Encoded, and constructor
input MakeIn of a
Struct
from its field map, handling optional,
mutable, and other field modifiers automatically.
Struct.Fields — constraint for the field map object
Struct.Type<F> — decoded type of the struct
Struct.Encoded<F> — encoded type of the struct
Struct.MakeIn<F> — constructor input (optional/defaulted fields may be omitted)
Struct.DecodingServices<F> / Struct.EncodingServices<F> — required services
Type-level representation returned by
Struct
.
Struct<function (type parameter) F in <Self, F extends CustomQueueItemFields = CustomQueueItemFields, E = never, R = never, RR = never>(tag: HyperlinkTag<Self, CustomQueueInstanceSpec<F>>, patch: ConfigPatch<CustomQueueLayerConfig<Schema.Struct<F>["Type"], E, R, RR>>): Layer.Layer<never>F>["Type"], function (type parameter) E in <Self, F extends CustomQueueItemFields = CustomQueueItemFields, E = never, R = never, RR = never>(tag: HyperlinkTag<Self, CustomQueueInstanceSpec<F>>, patch: ConfigPatch<CustomQueueLayerConfig<Schema.Struct<F>["Type"], E, R, RR>>): Layer.Layer<never>E, function (type parameter) R in <Self, F extends CustomQueueItemFields = CustomQueueItemFields, E = never, R = never, RR = never>(tag: HyperlinkTag<Self, CustomQueueInstanceSpec<F>>, patch: ConfigPatch<CustomQueueLayerConfig<Schema.Struct<F>["Type"], E, R, RR>>): Layer.Layer<never>R, function (type parameter) RR in <Self, F extends CustomQueueItemFields = CustomQueueItemFields, E = never, R = never, RR = never>(tag: HyperlinkTag<Self, CustomQueueInstanceSpec<F>>, patch: ConfigPatch<CustomQueueLayerConfig<Schema.Struct<F>["Type"], E, R, RR>>): Layer.Layer<never>RR>>,
): import LayerLayer.interface Layer<in ROut, out E = never, out RIn = never>A Layer describes how to build one or more services for dependency injection.
When to use
Use to model construction of application services for dependency injection,
especially when services have dependencies, can fail during construction, or
need scoped setup and release.
Details
A Layer<ROut, E, RIn> represents ROut as the services this layer
provides, E as the possible errors during layer construction, and RIn as
the services this layer requires as dependencies.
Layer<never> => import configureLayerconfigureLayer(tag: HyperlinkTag<
Self,
CustomQueueInstanceSpec<F>
>
tag.key, patch: ConfigPatch<
CustomQueueLayerConfig<
Schema.Struct<F>["Type"],
E,
R,
RR
>
>
patch);