<Self>(): {
<F extends Schema.Struct.Fields, Success extends Schema.Top, HSelf>(
key: string,
config: CustomQueueTagConfig<F, Success> & {
readonly node: NodeKey<HSelf>
}
): NodeBoundTag<Self, CustomQueueInstanceSpec<F>, HSelf>
<
F extends Schema.Struct.Fields,
Success extends Schema.Top = Schema.Void
>(
key: string,
config: CustomQueueTagConfig<F, Success>
): HyperlinkTag<Self, CustomQueueInstanceSpec<F>>
}Define an N-level managed queue as a named service Tag (also exported as
customQueueTag): class Jobs extends CustomQueueHyperlink.Tag<Jobs>()("@app/Jobs", { … }) {}.
The class is the Tag — yield* Jobs resolves the queue handle, layer provides it and
serve exposes it over RPC. payload is the item schema; levelCount / namedLevels
declare the priority levels; optional success / error add the worker wire schemas.
export const const customQueueTag: <Self>() => {
<
F extends Schema.Struct.Fields,
Success extends Schema.Top,
HSelf
>(
key: string,
config: CustomQueueTagConfig<F, Success> & {
readonly node: NodeKey<HSelf>
}
): NodeBoundTag<
Self,
CustomQueueInstanceSpec<F>,
HSelf
>
<
F extends Schema.Struct.Fields,
Success extends Schema.Top = Schema.Void
>(
key: string,
config: CustomQueueTagConfig<F, Success>
): HyperlinkTag<
Self,
CustomQueueInstanceSpec<F>
>
}
Define an N-level managed queue as a named service
Tag
(also exported as
customQueueTag
): class Jobs extends CustomQueueHyperlink.Tag<Jobs>()("@app/Jobs", { … }) {}.
The class is the Tag — yield* Jobs resolves the queue handle,
layer
provides it and
serve
exposes it over RPC. payload is the item schema; levelCount / namedLevels
declare the priority levels; optional success / error add the worker wire schemas.
customQueueTag = <function (type parameter) Self in <Self>(): {
<F extends Schema.Struct.Fields, Success extends Schema.Top, HSelf>(key: string, config: CustomQueueTagConfig<F, Success> & {
readonly node: NodeKey<HSelf>;
}): NodeBoundTag<Self, CustomQueueInstanceSpec<F>, HSelf>;
<F extends Schema.Struct.Fields, Success extends Schema.Top = Schema.Void>(key: string, config: CustomQueueTagConfig<F, Success>): HyperlinkTag<Self, CustomQueueInstanceSpec<F>>;
}
Self>() => {
function function (local function) build<F extends Schema.Struct.Fields, Success extends Schema.Top, HSelf>(key: string, config: CustomQueueTagConfig<F, Success> & {
readonly node: NodeKey<HSelf>;
}): NodeBoundTag<Self, CustomQueueInstanceSpec<F>, HSelf> (+1 overload)
build<
function (type parameter) F in build<F extends Schema.Struct.Fields, Success extends Schema.Top, HSelf>(key: string, config: CustomQueueTagConfig<F, Success> & {
readonly node: NodeKey<HSelf>;
}): NodeBoundTag<Self, CustomQueueInstanceSpec<F>, HSelf>
F extends import SchemaSchema.Struct.type Struct<Fields extends Struct.Fields>.Fields = {
readonly [x: string]: Schema.Constraint;
readonly [x: number]: Schema.Constraint;
readonly [x: symbol]: Schema.Constraint;
}
Constraint for a struct field map: an object whose values are schemas.
Fields,
function (type parameter) Success in build<F extends Schema.Struct.Fields, Success extends Schema.Top, HSelf>(key: string, config: CustomQueueTagConfig<F, Success> & {
readonly node: NodeKey<HSelf>;
}): NodeBoundTag<Self, CustomQueueInstanceSpec<F>, HSelf>
Success extends import SchemaSchema.Top,
function (type parameter) HSelf in build<F extends Schema.Struct.Fields, Success extends Schema.Top, HSelf>(key: string, config: CustomQueueTagConfig<F, Success> & {
readonly node: NodeKey<HSelf>;
}): NodeBoundTag<Self, CustomQueueInstanceSpec<F>, HSelf>
HSelf,
>(
key: stringkey: string,
config: CustomQueueTagConfig<F, Success> & {
readonly node: NodeKey<HSelf>
}
config: interface CustomQueueTagConfig<F extends Schema.Struct.Fields, Success extends Schema.Top = Schema.Void>CustomQueue Tag config — config object only (no positional schemas). payload is the item
schema; levelCount is the number of priority lanes; namedLevels maps names → lane indices.
Optional success / error wire slots match
QueueHyperlink.Tag
(stamped for engine + store).
CustomQueueTagConfig<function (type parameter) F in build<F extends Schema.Struct.Fields, Success extends Schema.Top, HSelf>(key: string, config: CustomQueueTagConfig<F, Success> & {
readonly node: NodeKey<HSelf>;
}): NodeBoundTag<Self, CustomQueueInstanceSpec<F>, HSelf>
F, function (type parameter) Success in build<F extends Schema.Struct.Fields, Success extends Schema.Top, HSelf>(key: string, config: CustomQueueTagConfig<F, Success> & {
readonly node: NodeKey<HSelf>;
}): NodeBoundTag<Self, CustomQueueInstanceSpec<F>, HSelf>
Success> & { readonly node: NodeKey<HSelf>node: import NodeKeyNodeKey<function (type parameter) HSelf in build<F extends Schema.Struct.Fields, Success extends Schema.Top, HSelf>(key: string, config: CustomQueueTagConfig<F, Success> & {
readonly node: NodeKey<HSelf>;
}): NodeBoundTag<Self, CustomQueueInstanceSpec<F>, HSelf>
HSelf> },
): import NodeBoundTagNodeBoundTag<function (type parameter) Self in <Self>(): {
<F extends Schema.Struct.Fields, Success extends Schema.Top, HSelf>(key: string, config: CustomQueueTagConfig<F, Success> & {
readonly node: NodeKey<HSelf>;
}): NodeBoundTag<Self, CustomQueueInstanceSpec<F>, HSelf>;
<F extends Schema.Struct.Fields, Success extends Schema.Top = Schema.Void>(key: string, config: CustomQueueTagConfig<F, Success>): HyperlinkTag<Self, CustomQueueInstanceSpec<F>>;
}
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 build<F extends Schema.Struct.Fields, Success extends Schema.Top, HSelf>(key: string, config: CustomQueueTagConfig<F, Success> & {
readonly node: NodeKey<HSelf>;
}): NodeBoundTag<Self, CustomQueueInstanceSpec<F>, HSelf>
F>, function (type parameter) HSelf in build<F extends Schema.Struct.Fields, Success extends Schema.Top, HSelf>(key: string, config: CustomQueueTagConfig<F, Success> & {
readonly node: NodeKey<HSelf>;
}): NodeBoundTag<Self, CustomQueueInstanceSpec<F>, HSelf>
HSelf>;
function function (local function) build<F extends Schema.Struct.Fields, Success extends Schema.Top = Schema.Void>(key: string, config: CustomQueueTagConfig<F, Success>): HyperlinkTag<Self, CustomQueueInstanceSpec<F>> (+1 overload)build<
function (type parameter) F in build<F extends Schema.Struct.Fields, Success extends Schema.Top = Schema.Void>(key: string, config: CustomQueueTagConfig<F, Success>): HyperlinkTag<Self, CustomQueueInstanceSpec<F>>F extends import SchemaSchema.Struct.type Struct<Fields extends Struct.Fields>.Fields = {
readonly [x: string]: Schema.Constraint;
readonly [x: number]: Schema.Constraint;
readonly [x: symbol]: Schema.Constraint;
}
Constraint for a struct field map: an object whose values are schemas.
Fields,
function (type parameter) Success in build<F extends Schema.Struct.Fields, Success extends Schema.Top = Schema.Void>(key: string, config: CustomQueueTagConfig<F, Success>): HyperlinkTag<Self, CustomQueueInstanceSpec<F>>Success extends import SchemaSchema.Top = typeof import SchemaSchema.const Void: Schema.Voidconst Void: {
Rebuild: Rebuild;
Iso: Iso;
ast: Ast;
Type: T;
Encoded: E;
DecodingServices: RD;
EncodingServices: RE;
annotate: (annotations: Schema.Annotations.Bottom<void, readonly []>) => Schema.Void;
annotateKey: (annotations: Schema.Annotations.Key<void>) => Schema.Void;
check: (checks_0: Check<void>, ...checks: Array<Check<void>>) => Schema.Void;
rebuild: (ast: Void) => Schema.Void;
make: (input: void, options?: Schema.MakeOptions) => void;
makeOption: (input: void, options?: Schema.MakeOptions) => Option.Option<void>;
makeEffect: (input: void, options?: Schema.MakeOptions) => Effect.Effect<void, Schema.SchemaError, never>;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
Type-level representation of
Void
.
Schema for a TypeScript void return value.
When to use
Use when you need to model the return value of a function, RPC, or endpoint
whose result is intentionally ignored.
Details
Runtime parsing accepts any present value and discards it, producing
undefined. The public decoded and encoded TypeScript representation remains
void, so typed construction, decoding, and encoding APIs are still modeled
as void.
Void,
>(
key: stringkey: string,
config: CustomQueueTagConfig<F, Success>(parameter) config: {
payload: Schema.Struct<F>;
levelCount: number;
namedLevels: Readonly<Record<string, number>>;
success: Success;
error: Schema.Top;
description: string;
node: NodeKey<unknown>;
}
config: interface CustomQueueTagConfig<F extends Schema.Struct.Fields, Success extends Schema.Top = Schema.Void>CustomQueue Tag config — config object only (no positional schemas). payload is the item
schema; levelCount is the number of priority lanes; namedLevels maps names → lane indices.
Optional success / error wire slots match
QueueHyperlink.Tag
(stamped for engine + store).
CustomQueueTagConfig<function (type parameter) F in build<F extends Schema.Struct.Fields, Success extends Schema.Top = Schema.Void>(key: string, config: CustomQueueTagConfig<F, Success>): HyperlinkTag<Self, CustomQueueInstanceSpec<F>>F, function (type parameter) Success in build<F extends Schema.Struct.Fields, Success extends Schema.Top = Schema.Void>(key: string, config: CustomQueueTagConfig<F, Success>): HyperlinkTag<Self, CustomQueueInstanceSpec<F>>Success>,
): import HyperlinkTagHyperlinkTag<function (type parameter) Self in <Self>(): {
<F extends Schema.Struct.Fields, Success extends Schema.Top, HSelf>(key: string, config: CustomQueueTagConfig<F, Success> & {
readonly node: NodeKey<HSelf>;
}): NodeBoundTag<Self, CustomQueueInstanceSpec<F>, HSelf>;
<F extends Schema.Struct.Fields, Success extends Schema.Top = Schema.Void>(key: string, config: CustomQueueTagConfig<F, Success>): HyperlinkTag<Self, CustomQueueInstanceSpec<F>>;
}
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 build<F extends Schema.Struct.Fields, Success extends Schema.Top = Schema.Void>(key: string, config: CustomQueueTagConfig<F, Success>): HyperlinkTag<Self, CustomQueueInstanceSpec<F>>F>>;
function function (local function) build<F extends Schema.Struct.Fields, Success extends Schema.Top, HSelf>(key: string, config: CustomQueueTagConfig<F, Success> & {
readonly node: NodeKey<HSelf>;
}): NodeBoundTag<Self, CustomQueueInstanceSpec<F>, HSelf> (+1 overload)
build<function (type parameter) F in build<F extends Schema.Struct.Fields, Success extends Schema.Top>(key: string, config: CustomQueueTagConfig<F, Success>): HyperlinkTag<Self, CustomQueueInstanceSpec<F>>F extends import SchemaSchema.Struct.type Struct<Fields extends Struct.Fields>.Fields = {
readonly [x: string]: Schema.Constraint;
readonly [x: number]: Schema.Constraint;
readonly [x: symbol]: Schema.Constraint;
}
Constraint for a struct field map: an object whose values are schemas.
Fields, function (type parameter) Success in build<F extends Schema.Struct.Fields, Success extends Schema.Top>(key: string, config: CustomQueueTagConfig<F, Success>): HyperlinkTag<Self, CustomQueueInstanceSpec<F>>Success extends import SchemaSchema.Top>(
key: stringkey: string,
config: CustomQueueTagConfig<F, Success>(parameter) config: {
payload: Schema.Struct<F>;
levelCount: number;
namedLevels: Readonly<Record<string, number>>;
success: Success;
error: Schema.Top;
description: string;
node: NodeKey<unknown>;
}
config: interface CustomQueueTagConfig<F extends Schema.Struct.Fields, Success extends Schema.Top = Schema.Void>CustomQueue Tag config — config object only (no positional schemas). payload is the item
schema; levelCount is the number of priority lanes; namedLevels maps names → lane indices.
Optional success / error wire slots match
QueueHyperlink.Tag
(stamped for engine + store).
CustomQueueTagConfig<function (type parameter) F in build<F extends Schema.Struct.Fields, Success extends Schema.Top>(key: string, config: CustomQueueTagConfig<F, Success>): HyperlinkTag<Self, CustomQueueInstanceSpec<F>>F, function (type parameter) Success in build<F extends Schema.Struct.Fields, Success extends Schema.Top>(key: string, config: CustomQueueTagConfig<F, Success>): HyperlinkTag<Self, CustomQueueInstanceSpec<F>>Success>,
): import HyperlinkTagHyperlinkTag<function (type parameter) Self in <Self>(): {
<F extends Schema.Struct.Fields, Success extends Schema.Top, HSelf>(key: string, config: CustomQueueTagConfig<F, Success> & {
readonly node: NodeKey<HSelf>;
}): NodeBoundTag<Self, CustomQueueInstanceSpec<F>, HSelf>;
<F extends Schema.Struct.Fields, Success extends Schema.Top = Schema.Void>(key: string, config: CustomQueueTagConfig<F, Success>): HyperlinkTag<Self, CustomQueueInstanceSpec<F>>;
}
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 build<F extends Schema.Struct.Fields, Success extends Schema.Top>(key: string, config: CustomQueueTagConfig<F, Success>): HyperlinkTag<Self, CustomQueueInstanceSpec<F>>F>> {
const const levelConfig: CustomQueueLevelConfiglevelConfig: type CustomQueueTagLevelConfig =
CustomQueueLevelConfig
Lane config for a custom queue tag.
CustomQueueTagLevelConfig = {
levelCount: numberlevelCount: config: CustomQueueTagConfig<F, Success>(parameter) config: {
payload: Schema.Struct<F>;
levelCount: number;
namedLevels: Readonly<Record<string, number>>;
success: Success;
error: Schema.Top;
description: string;
node: NodeKey<unknown>;
}
config.CustomQueueTagConfig<F, Success>.levelCount: numberlevelCount,
namedLevels: Readonly<Record<string, number>>namedLevels: config: CustomQueueTagConfig<F, Success>(parameter) config: {
payload: Schema.Struct<F>;
levelCount: number;
namedLevels: Readonly<Record<string, number>>;
success: Success;
error: Schema.Top;
description: string;
node: NodeKey<unknown>;
}
config.CustomQueueTagConfig<F, Success>.namedLevels?: Readonly<Record<string, number>> | undefinednamedLevels ?? {},
};
const const wire: {
success: Success | undefined
error: Schema.Top | undefined
}
wire = { success: Success | undefinedsuccess: config: CustomQueueTagConfig<F, Success>(parameter) config: {
payload: Schema.Struct<F>;
levelCount: number;
namedLevels: Readonly<Record<string, number>>;
success: Success;
error: Schema.Top;
description: string;
node: NodeKey<unknown>;
}
config.CustomQueueTagConfig<F, Success>.success?: Success | undefinedsuccess, error: Schema.Top | undefinederror: config: CustomQueueTagConfig<F, Success>(parameter) config: {
payload: Schema.Struct<F>;
levelCount: number;
namedLevels: Readonly<Record<string, number>>;
success: Success;
error: Schema.Top;
description: string;
node: NodeKey<unknown>;
}
config.CustomQueueTagConfig<F, Success>.error?: Schema.Top | undefinederror };
const const spec: anyspec = import assertCustomQueueInstanceSpecassertCustomQueueInstanceSpec<function (type parameter) F in build<F extends Schema.Struct.Fields, Success extends Schema.Top>(key: string, config: CustomQueueTagConfig<F, Success>): HyperlinkTag<Self, CustomQueueInstanceSpec<F>>F>(
const customQueueSpec: <F>(
itemSchema: Schema.Struct<F>,
levelConfig: CustomQueueLevelConfig,
wire?: {
readonly success?: Schema.Top
readonly error?: Schema.Top
}
) => {
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
}
}
Build a custom-queue instance spec: shared
customQueueControlSpec
plus
per-instance data-plane procedures typed by itemSchema.
customQueueSpec(config: CustomQueueTagConfig<F, Success>(parameter) config: {
payload: Schema.Struct<F>;
levelCount: number;
namedLevels: Readonly<Record<string, number>>;
success: Success;
error: Schema.Top;
description: string;
node: NodeKey<unknown>;
}
config.CustomQueueTagConfig<F, Success>.payload: Schema.Struct<F>(property) CustomQueueTagConfig<F, Success>.payload: {
Type: Struct.Type<Fields>;
Encoded: Struct.Encoded<Fields>;
DecodingServices: Struct.DecodingServices<Fields>;
EncodingServices: Struct.EncodingServices<Fields>;
Iso: Struct.Iso<Fields>;
fields: Fields;
mapFields: (f: (fields: F) => To, options?: { readonly unsafePreserveChecks?: boolean | undefined } | undefined) => Schema.Struct<{ [K in keyof Readonly<To>]: Readonly<To>[K]; }>;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>, readonly []>) => Schema.Struct<F>;
annotateKey: (annotations: Schema.Annotations.Key<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>>) => Schema.Struct<F>;
check: (checks_0: Check<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>>, ...checks: Array<Check<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>…;
rebuild: (ast: Objects) => Schema.Struct<F>;
make: (input: Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKeys<F>>, options?: Schema.MakeOptions) => Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMut…;
makeOption: (input: Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKeys<F>>, options?: Schema.MakeOptions) => Option.Option<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.…;
makeEffect: (input: Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKeys<F>>, options?: Schema.MakeOptions) => Effect.Effect<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.…;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
payload, const levelConfig: CustomQueueLevelConfiglevelConfig, const wire: {
success: Success | undefined
error: Schema.Top | undefined
}
wire),
const customQueueSpec: <F>(
itemSchema: Schema.Struct<F>,
levelConfig: CustomQueueLevelConfig,
wire?: {
readonly success?: Schema.Top
readonly error?: Schema.Top
}
) => {
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
}
}
Build a custom-queue instance spec: shared
customQueueControlSpec
plus
per-instance data-plane procedures typed by itemSchema.
customQueueSpec(config: CustomQueueTagConfig<F, Success>(parameter) config: {
payload: Schema.Struct<F>;
levelCount: number;
namedLevels: Readonly<Record<string, number>>;
success: Success;
error: Schema.Top;
description: string;
node: NodeKey<unknown>;
}
config.CustomQueueTagConfig<F, Success>.payload: Schema.Struct<F>(property) CustomQueueTagConfig<F, Success>.payload: {
Type: Struct.Type<Fields>;
Encoded: Struct.Encoded<Fields>;
DecodingServices: Struct.DecodingServices<Fields>;
EncodingServices: Struct.EncodingServices<Fields>;
Iso: Struct.Iso<Fields>;
fields: Fields;
mapFields: (f: (fields: F) => To, options?: { readonly unsafePreserveChecks?: boolean | undefined } | undefined) => Schema.Struct<{ [K in keyof Readonly<To>]: Readonly<To>[K]; }>;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>, readonly []>) => Schema.Struct<F>;
annotateKey: (annotations: Schema.Annotations.Key<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>>) => Schema.Struct<F>;
check: (checks_0: Check<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>>, ...checks: Array<Check<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMutableKeys<F>>…;
rebuild: (ast: Objects) => Schema.Struct<F>;
make: (input: Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKeys<F>>, options?: Schema.MakeOptions) => Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.Struct.TypeMut…;
makeOption: (input: Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKeys<F>>, options?: Schema.MakeOptions) => Option.Option<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.…;
makeEffect: (input: Schema.Struct.MakeInView<F, Schema.Struct.TypeOptionalKeys<F> | Schema.Struct.TypeConstructorDefaultedKeys<F>>, options?: Schema.MakeOptions) => Effect.Effect<Schema.Struct.View<F, 'Type', Schema.Struct.TypeOptionalKeys<F>, Schema.…;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
payload, const levelConfig: CustomQueueLevelConfiglevelConfig),
const wire: {
success: Success | undefined
error: Schema.Top | undefined
}
wire,
);
const const base: anybase =
config: CustomQueueTagConfig<F, Success>(parameter) config: {
payload: Schema.Struct<F>;
levelCount: number;
namedLevels: Readonly<Record<string, number>>;
success: Success;
error: Schema.Top;
description: string;
node: NodeKey<unknown>;
}
config.CustomQueueTagConfig<F extends Schema.Struct.Fields, Success extends Schema.Top = Void>.node?: anynode === var undefinedundefined
? import HyperlinkHyperlink.Tag<function (type parameter) Self in <Self>(): {
<F extends Schema.Struct.Fields, Success extends Schema.Top, HSelf>(key: string, config: CustomQueueTagConfig<F, Success> & {
readonly node: NodeKey<HSelf>;
}): NodeBoundTag<Self, CustomQueueInstanceSpec<F>, HSelf>;
<F extends Schema.Struct.Fields, Success extends Schema.Top = Schema.Void>(key: string, config: CustomQueueTagConfig<F, Success>): HyperlinkTag<Self, CustomQueueInstanceSpec<F>>;
}
Self>()(key: stringkey, const spec: anyspec, { description: string | undefineddescription: config: CustomQueueTagConfig<F, Success>(parameter) config: {
payload: Schema.Struct<F>;
levelCount: number;
namedLevels: Readonly<Record<string, number>>;
success: Success;
error: Schema.Top;
description: string;
node: NodeKey<unknown>;
}
config.CustomQueueTagConfig<F, Success>.description?: string | undefineddescription, kind: stringkind })
: import HyperlinkHyperlink.Tag<function (type parameter) Self in <Self>(): {
<F extends Schema.Struct.Fields, Success extends Schema.Top, HSelf>(key: string, config: CustomQueueTagConfig<F, Success> & {
readonly node: NodeKey<HSelf>;
}): NodeBoundTag<Self, CustomQueueInstanceSpec<F>, HSelf>;
<F extends Schema.Struct.Fields, Success extends Schema.Top = Schema.Void>(key: string, config: CustomQueueTagConfig<F, Success>): HyperlinkTag<Self, CustomQueueInstanceSpec<F>>;
}
Self>()(key: stringkey, const spec: anyspec, {
description: string | undefineddescription: config: CustomQueueTagConfig<F, Success>(parameter) config: {
payload: Schema.Struct<F>;
levelCount: number;
namedLevels: Readonly<Record<string, number>>;
success: Success;
error: Schema.Top;
description: string;
node: NodeKey<unknown>;
}
config.CustomQueueTagConfig<F, Success>.description?: string | undefineddescription,
kind: stringkind,
node: anynode: config: CustomQueueTagConfig<F, Success>(parameter) config: {
payload: Schema.Struct<F>;
levelCount: number;
namedLevels: Readonly<Record<string, number>>;
success: Success;
error: Schema.Top;
description: string;
node: NodeKey<unknown>;
}
config.CustomQueueTagConfig<F extends Schema.Struct.Fields, Success extends Schema.Top = Void>.node?: anynode,
});
const const ready: anyready = import HyperlinkHyperlink.withReadiness(const base: anybase, (svc: anysvc) =>
import EffectEffect.const map: <unknown, unknown, unknown, {
detail?: string | undefined;
ready: boolean;
}>(self: Effect.Effect<unknown, unknown, unknown>, f: (a: unknown) => {
detail?: string | undefined;
ready: boolean;
}) => Effect.Effect<{
detail?: string | undefined;
ready: boolean;
}, unknown, unknown> (+1 overload)
Transforms the value inside an effect by applying a function to it.
When to use
Use to transform an effect's success value with a function that returns a
plain value, producing a new effect without changing the original effect's
typed error or context requirements.
Details
map takes a function and applies it to the value contained within an
effect, creating a new effect with the transformed value.
It's important to note that effects are immutable, meaning that the original
effect is not modified. Instead, a new effect is returned with the updated
value.
Example (Choosing map syntax variants)
import { Effect, pipe } from "effect"
const myEffect = Effect.succeed(1)
const transformation = (n: number) => n + 1
const mappedWithPipe = pipe(myEffect, Effect.map(transformation))
const mappedWithDataFirst = Effect.map(myEffect, transformation)
const mappedWithMethod = myEffect.pipe(Effect.map(transformation))
Example (Adding a service charge)
import { Effect, pipe } from "effect"
const addServiceCharge = (amount: number) => amount + 1
const fetchTransactionAmount = Effect.promise(() => Promise.resolve(100))
const finalAmount = pipe(
fetchTransactionAmount,
Effect.map(addServiceCharge)
)
Effect.runPromise(finalAmount).then(console.log)
// Output: 101
map(svc: anysvc.status.get, (status: unknownstatus) => ({
ready: booleanready: status: unknownstatus.phase === "running",
...(status: unknownstatus.phase === "running"
? {}
: { detail?: string | undefineddetail: `phase: ${status: unknownstatus.phase}` }),
})),
);
return import stampQueueWireSchemasstampQueueWireSchemas(const ready: anyready, {
success: Success | undefinedsuccess: config: CustomQueueTagConfig<F, Success>(parameter) config: {
payload: Schema.Struct<F>;
levelCount: number;
namedLevels: Readonly<Record<string, number>>;
success: Success;
error: Schema.Top;
description: string;
node: NodeKey<unknown>;
}
config.CustomQueueTagConfig<F, Success>.success?: Success | undefinedsuccess,
error: Schema.Top | undefinederror: config: CustomQueueTagConfig<F, Success>(parameter) config: {
payload: Schema.Struct<F>;
levelCount: number;
namedLevels: Readonly<Record<string, number>>;
success: Success;
error: Schema.Top;
description: string;
node: NodeKey<unknown>;
}
config.CustomQueueTagConfig<F, Success>.error?: Schema.Top | undefinederror,
});
}
return function (local function) build<F extends Schema.Struct.Fields, Success extends Schema.Top, HSelf>(key: string, config: CustomQueueTagConfig<F, Success> & {
readonly node: NodeKey<HSelf>;
}): NodeBoundTag<Self, CustomQueueInstanceSpec<F>, HSelf> (+1 overload)
build;
};