DurableDeferred.ts overview
Since v1.0.0
Exports Grouped by Category
Combinators
await
Signature
declare const await: <Success extends Schema.Schema.Any, Error extends Schema.Schema.All>(
self: DurableDeferred<Success, Error>
) => Effect.Effect<
Success["Type"],
Error["Type"],
WorkflowEngine | WorkflowInstance | Success["Context"] | Error["Context"]
>
Since v1.0.0
done
Signature
declare const done: {
<Success extends Schema.Schema.Any, Error extends Schema.Schema.All>(options: {
readonly token: Token
readonly exit: Exit.Exit<Success["Type"], Error["Type"]>
}): (
self: DurableDeferred<Success, Error>
) => Effect.Effect<void, never, WorkflowEngine | Success["Context"] | Error["Context"]>
<Success extends Schema.Schema.Any, Error extends Schema.Schema.All>(
self: DurableDeferred<Success, Error>,
options: { readonly token: Token; readonly exit: Exit.Exit<Success["Type"], Error["Type"]> }
): Effect.Effect<void, never, WorkflowEngine | Success["Context"] | Error["Context"]>
}
Since v1.0.0
fail
Signature
declare const fail: {
<Success extends Schema.Schema.Any, Error extends Schema.Schema.All>(options: {
readonly token: Token
readonly error: Error["Type"]
}): (self: DurableDeferred<Success, Error>) => Effect.Effect<void, never, WorkflowEngine | Error["Context"]>
<Success extends Schema.Schema.Any, Error extends Schema.Schema.All>(
self: DurableDeferred<Success, Error>,
options: { readonly token: Token; readonly error: Error["Type"] }
): Effect.Effect<void, never, WorkflowEngine | Error["Context"]>
}
Since v1.0.0
failCause
Signature
declare const failCause: {
<Success extends Schema.Schema.Any, Error extends Schema.Schema.All>(options: {
readonly token: Token
readonly cause: Cause.Cause<Error["Type"]>
}): (self: DurableDeferred<Success, Error>) => Effect.Effect<void, never, WorkflowEngine | Error["Context"]>
<Success extends Schema.Schema.Any, Error extends Schema.Schema.All>(
self: DurableDeferred<Success, Error>,
options: { readonly token: Token; readonly cause: Cause.Cause<Error["Type"]> }
): Effect.Effect<void, never, WorkflowEngine | Error["Context"]>
}
Since v1.0.0
succeed
Signature
declare const succeed: {
<Success extends Schema.Schema.Any, Error extends Schema.Schema.All>(options: {
readonly token: Token
readonly value: Success["Type"]
}): (self: DurableDeferred<Success, Error>) => Effect.Effect<void, never, WorkflowEngine | Success["Context"]>
<Success extends Schema.Schema.Any, Error extends Schema.Schema.All>(
self: DurableDeferred<Success, Error>,
options: { readonly token: Token; readonly value: Success["Type"] }
): Effect.Effect<void, never, WorkflowEngine | Success["Context"]>
}
Since v1.0.0
Constructors
make
Signature
declare const make: <
Success extends Schema.Schema.Any = typeof Schema.Void,
Error extends Schema.Schema.All = typeof Schema.Never
>(
name: string,
options?: { readonly success?: Success; readonly error?: Error }
) => DurableDeferred<Success, Error>
Since v1.0.0
Models
Any (interface)
Signature
export interface Any {
readonly [TypeId]: TypeId
readonly name: string
readonly successSchema: Schema.Schema.Any
readonly errorSchema: Schema.Schema.All
readonly exitSchema: Schema.Exit<any, any, any>
}
Since v1.0.0
DurableDeferred (interface)
Signature
export interface DurableDeferred<
Success extends Schema.Schema.Any,
Error extends Schema.Schema.All = typeof Schema.Never
> {
readonly [TypeId]: TypeId
readonly name: string
readonly successSchema: Success
readonly errorSchema: Error
readonly exitSchema: Schema.Exit<Success, Error, typeof Schema.Defect>
}
Since v1.0.0
Symbols
TypeId
Signature
declare const TypeId: unique symbol
Since v1.0.0
TypeId (type alias)
Signature
type TypeId = typeof TypeId
Since v1.0.0
Token
Token
Signature
declare const Token: Schema.brand<typeof Schema.String, unique symbol>
Since v1.0.0
Token (type alias)
Signature
type Token = Brand.Branded<string, TokenTypeId>
Since v1.0.0
TokenParsed (class)
Signature
declare class TokenParsed
Since v1.0.0
TokenTypeId
Signature
declare const TokenTypeId: unique symbol
Since v1.0.0
TokenTypeId (type alias)
Signature
type TokenTypeId = typeof TokenTypeId
Since v1.0.0
token
Signature
declare const token: <Success extends Schema.Schema.Any, Error extends Schema.Schema.All>(
self: DurableDeferred<Success, Error>
) => Effect.Effect<Token, never, WorkflowInstance>
Since v1.0.0
tokenFromExecutionId
Signature
declare const tokenFromExecutionId: {
(options: {
readonly workflow: Workflow.Any
readonly executionId: string
}): <Success extends Schema.Schema.Any, Error extends Schema.Schema.All>(
self: DurableDeferred<Success, Error>
) => Token
<Success extends Schema.Schema.Any, Error extends Schema.Schema.All>(
self: DurableDeferred<Success, Error>,
options: { readonly workflow: Workflow.Any; readonly executionId: string }
): Token
}
Since v1.0.0
tokenFromPayload
Signature
declare const tokenFromPayload: {
<W extends Workflow.Any>(options: {
readonly workflow: W
readonly payload: Schema.Simplify<Schema.Struct.Constructor<W["payloadSchema"]["fields"]>>
}): <Success extends Schema.Schema.Any, Error extends Schema.Schema.All>(
self: DurableDeferred<Success, Error>
) => Effect.Effect<Token>
<Success extends Schema.Schema.Any, Error extends Schema.Schema.All, W extends Workflow.Any>(
self: DurableDeferred<Success, Error>,
options: {
readonly workflow: W
readonly payload: Schema.Simplify<Schema.Struct.Constructor<W["payloadSchema"]["fields"]>>
}
): Effect.Effect<Token>
}
Since v1.0.0