Another process already owns this resource key — original is where to dial.
errors
Source src/Lookup.ts:867 lines
export class class DuplicateIdentityclass DuplicateIdentity {
_tag: 'DuplicateIdentity';
key: string;
original: Endpoint;
name: string;
message: string;
stack: string;
cause: unknown;
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; <…;
toString: () => string;
toJSON: () => unknown;
}
Another process already owns this resource key — original is where to dial.
DuplicateIdentity extends import SchemaSchema.const TaggedErrorClass: <DuplicateIdentity, {}>(identifier?: string) => {
<Tag, Fields>(tag: Tag, fields: Fields, annotations?: Schema.Annotations.Declaration<DuplicateIdentity, readonly [Schema.TaggedStruct<Tag, Fields>]> | undefined): Schema.Class<DuplicateIdentity, Schema.TaggedStruct<Tag, Fields>, YieldableError>;
<Tag, S>(tag: Tag, schema: S, annotations?: Schema.Annotations.Declaration<DuplicateIdentity, readonly [...]> | undefined): Schema.Class<...>;
}
Defines a schema-backed yieldable error class with an automatically populated
_tag field.
When to use
Use to define typed errors that are schema validated, yielded in Effect.gen,
and matched as tagged union members.
Example (Defining a tagged error class)
import { Effect, Schema } from "effect"
class NotFound extends Schema.TaggedErrorClass<NotFound>()("NotFound", {
id: Schema.Number
}) {}
const program = Effect.gen(function*() {
yield* new NotFound({ id: 42 })
})
TaggedErrorClass<class DuplicateIdentityclass DuplicateIdentity {
_tag: 'DuplicateIdentity';
key: string;
original: Endpoint;
name: string;
message: string;
stack: string;
cause: unknown;
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; <…;
toString: () => string;
toJSON: () => unknown;
}
Another process already owns this resource key — original is where to dial.
DuplicateIdentity>()(
"DuplicateIdentity",
{
key: Schema.String(property) key: {
Rebuild: Rebuild;
Iso: Iso;
ast: Ast;
Type: T;
Encoded: E;
DecodingServices: RD;
EncodingServices: RE;
annotate: (annotations: Schema.Annotations.Bottom<string, readonly []>) => Schema.String;
annotateKey: (annotations: Schema.Annotations.Key<string>) => Schema.String;
check: (checks_0: Check<string>, ...checks: Array<Check<string>>) => Schema.String;
rebuild: (ast: String) => Schema.String;
make: (input: string, options?: Schema.MakeOptions) => string;
makeOption: (input: string, options?: Schema.MakeOptions) => Option.Option<string>;
makeEffect: (input: string, options?: Schema.MakeOptions) => Effect.Effect<string, 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; <…;
}
key: import SchemaSchema.const String: Schema.Stringconst String: {
Rebuild: Rebuild;
Iso: Iso;
ast: Ast;
Type: T;
Encoded: E;
DecodingServices: RD;
EncodingServices: RE;
annotate: (annotations: Schema.Annotations.Bottom<string, readonly []>) => Schema.String;
annotateKey: (annotations: Schema.Annotations.Key<string>) => Schema.String;
check: (checks_0: Check<string>, ...checks: Array<Check<string>>) => Schema.String;
rebuild: (ast: String) => Schema.String;
make: (input: string, options?: Schema.MakeOptions) => string;
makeOption: (input: string, options?: Schema.MakeOptions) => Option.Option<string>;
makeEffect: (input: string, options?: Schema.MakeOptions) => Effect.Effect<string, 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
String
.
Schema for string values. Validates that the input is typeof "string".
String,
original: typeof Endpoint(property) original: {
Type: Self;
Encoded: S["Encoded"];
DecodingServices: S["DecodingServices"];
EncodingServices: S["EncodingServices"];
Iso: S["Iso"];
identifier: string;
fields: S["fields"];
mapFields: (f: (fields: { readonly nodeKey: Schema.String; readonly kind: Schema.Literals<readonly ['Http', 'WebSocket', 'IpcSocket']>; readonly url: Schema.optionalKey<Schema.String>; readonly path: Schema.optionalKey<Schema.String> }) => To, option…;
extend: (identifier: string) => { (fields: NewFields, annotations?: Schema.Annotations.Declaration<Extended, readonly [Schema.Struct<{ [K in keyof { [K in keyof (('kind' | 'url' | 'path' | 'nodeKey') & keyof NewFields extends never ? { readonly no…;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<Endpoint, readonly [Schema.Struct<{ readonly nodeKey: Schema.String; readonly kind: Schema.Literals<readonly ['Http', 'WebSocket', 'IpcSocket']>; readonly url: Schema.optionalKey<Schema.String>; read…;
annotateKey: (annotations: Schema.Annotations.Key<Endpoint>) => Schema.decodeTo<Schema.declareConstructor<Endpoint, { readonly kind: 'Http' | 'WebSocket' | 'IpcSocket'; readonly nodeKey: string; readonly url?: string | undefined; readonly path?: string…;
check: (checks_0: Check<Endpoint>, ...checks: Array<Check<Endpoint>>) => Schema.decodeTo<Schema.declareConstructor<Endpoint, { readonly kind: 'Http' | 'WebSocket' | 'IpcSocket'; readonly nodeKey: string; readonly url?: string | undefined; readonl…;
rebuild: (ast: Declaration) => Schema.decodeTo<Schema.declareConstructor<Endpoint, { readonly kind: 'Http' | 'WebSocket' | 'IpcSocket'; readonly nodeKey: string; readonly url?: string | undefined; readonly path?: string | undefined }, readonly [Sch…;
make: (input: { readonly kind: 'Http' | 'WebSocket' | 'IpcSocket'; readonly nodeKey: string; readonly url?: string | undefined; readonly path?: string | undefined }, options?: Schema.MakeOptions) => Endpoint;
makeOption: (input: { readonly kind: 'Http' | 'WebSocket' | 'IpcSocket'; readonly nodeKey: string; readonly url?: string | undefined; readonly path?: string | undefined }, options?: Schema.MakeOptions) => Option.Option<Endpoint>;
makeEffect: (input: { readonly kind: 'Http' | 'WebSocket' | 'IpcSocket'; readonly nodeKey: string; readonly url?: string | undefined; readonly path?: string | undefined }, options?: Schema.MakeOptions) => Effect.Effect<Endpoint, Schema.SchemaError, ne…;
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; <…;
}
original: class Endpointclass Endpoint {
Type: Self;
Encoded: S["Encoded"];
DecodingServices: S["DecodingServices"];
EncodingServices: S["EncodingServices"];
Iso: S["Iso"];
identifier: string;
fields: S["fields"];
mapFields: (f: (fields: { readonly nodeKey: Schema.String; readonly kind: Schema.Literals<readonly ['Http', 'WebSocket', 'IpcSocket']>; readonly url: Schema.optionalKey<Schema.String>; readonly path: Schema.optionalKey<Schema.String> }) => To, option…;
extend: (identifier: string) => { (fields: NewFields, annotations?: Schema.Annotations.Declaration<Extended, readonly [Schema.Struct<{ [K in keyof { [K in keyof (('kind' | 'url' | 'path' | 'nodeKey') & keyof NewFields extends never ? { readonly no…;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<Endpoint, readonly [Schema.Struct<{ readonly nodeKey: Schema.String; readonly kind: Schema.Literals<readonly ['Http', 'WebSocket', 'IpcSocket']>; readonly url: Schema.optionalKey<Schema.String>; read…;
annotateKey: (annotations: Schema.Annotations.Key<Endpoint>) => Schema.decodeTo<Schema.declareConstructor<Endpoint, { readonly kind: 'Http' | 'WebSocket' | 'IpcSocket'; readonly nodeKey: string; readonly url?: string | undefined; readonly path?: string…;
check: (checks_0: Check<Endpoint>, ...checks: Array<Check<Endpoint>>) => Schema.decodeTo<Schema.declareConstructor<Endpoint, { readonly kind: 'Http' | 'WebSocket' | 'IpcSocket'; readonly nodeKey: string; readonly url?: string | undefined; readonl…;
rebuild: (ast: Declaration) => Schema.decodeTo<Schema.declareConstructor<Endpoint, { readonly kind: 'Http' | 'WebSocket' | 'IpcSocket'; readonly nodeKey: string; readonly url?: string | undefined; readonly path?: string | undefined }, readonly [Sch…;
make: (input: { readonly kind: 'Http' | 'WebSocket' | 'IpcSocket'; readonly nodeKey: string; readonly url?: string | undefined; readonly path?: string | undefined }, options?: Schema.MakeOptions) => Endpoint;
makeOption: (input: { readonly kind: 'Http' | 'WebSocket' | 'IpcSocket'; readonly nodeKey: string; readonly url?: string | undefined; readonly path?: string | undefined }, options?: Schema.MakeOptions) => Option.Option<Endpoint>;
makeEffect: (input: { readonly kind: 'Http' | 'WebSocket' | 'IpcSocket'; readonly nodeKey: string; readonly url?: string | undefined; readonly path?: string | undefined }, options?: Schema.MakeOptions) => Effect.Effect<Endpoint, Schema.SchemaError, ne…;
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; <…;
}
Where a winning claimant / advertised node lives — node key + transport address.
Endpoint,
},
) {}