/** * @since 1.0.0 */ import * as Rpc from "@effect/rpc/Rpc"; import * as RpcClient_ from "@effect/rpc/RpcClient"; import type { RpcClientError } from "@effect/rpc/RpcClientError"; import * as RpcGroup from "@effect/rpc/RpcGroup"; import * as RpcSchema from "@effect/rpc/RpcSchema"; import * as Context from "effect/Context"; import * as Effect from "effect/Effect"; import * as Layer from "effect/Layer"; import * as Option from "effect/Option"; import * as Schema from "effect/Schema"; import type { Scope } from "effect/Scope"; import type { PersistenceError } from "./ClusterError.js"; import { AlreadyProcessingMessage, EntityNotAssignedToRunner, MailboxFull, RunnerUnavailable } from "./ClusterError.js"; import * as Envelope from "./Envelope.js"; import * as Message from "./Message.js"; import * as MessageStorage from "./MessageStorage.js"; import * as Reply from "./Reply.js"; import type { RunnerAddress } from "./RunnerAddress.js"; import { ShardingConfig } from "./ShardingConfig.js"; import * as Snowflake from "./Snowflake.js"; declare const Runners_base: Context.TagClass Effect.Effect; /** * Send a message locally. * * This ensures that the message hits storage before being sent to the local * entity. */ readonly sendLocal: (options: { readonly message: Message.Outgoing; readonly send: (message: Message.IncomingLocal) => Effect.Effect; readonly simulateRemoteSerialization: boolean; }) => Effect.Effect; /** * Send a message to a Runner. */ readonly send: (options: { readonly address: RunnerAddress; readonly message: Message.Outgoing; }) => Effect.Effect; /** * Notify a Runner that a message is available, then read replies from storage. */ readonly notify: (options: { readonly address: Option.Option; readonly message: Message.Outgoing; readonly discard: boolean; }) => Effect.Effect; /** * Notify the current Runner that a message is available, then read replies from * storage. * * This ensures that the message hits storage before being sent to the local * entity. */ readonly notifyLocal: (options: { readonly message: Message.Outgoing; readonly notify: (options: Message.IncomingLocal) => Effect.Effect; readonly discard: boolean; readonly storageOnly?: boolean | undefined; }) => Effect.Effect; /** * Mark a Runner as unavailable. */ readonly onRunnerUnavailable: (address: RunnerAddress) => Effect.Effect; }>; /** * @since 1.0.0 * @category context */ export declare class Runners extends Runners_base { } /** * @since 1.0.0 * @category Constructors */ export declare const make: (options: Omit) => Effect.Effect; /** * @since 1.0.0 * @category No-op */ export declare const makeNoop: Effect.Effect; /** * @since 1.0.0 * @category Layers */ export declare const layerNoop: Layer.Layer; declare const Rpcs_base: RpcGroup.RpcGroup | Rpc.Rpc<"Notify", Schema.Struct<{ envelope: Schema.Union<[Schema.Struct<{ _tag: Schema.Literal<["Request"]>; requestId: Schema.Schema; address: typeof import("./EntityAddress.js").EntityAddress; tag: typeof Schema.String; payload: typeof Schema.Unknown; headers: Schema.Schema>; traceId: Schema.optional; spanId: Schema.optional; sampled: Schema.optional; }>, typeof Envelope.AckChunk, typeof Envelope.Interrupt]>; }>, typeof Schema.Void, Schema.Union<[typeof EntityNotAssignedToRunner, typeof AlreadyProcessingMessage]>, never> | Rpc.Rpc<"Effect", Schema.Struct<{ request: Schema.Struct<{ _tag: Schema.Literal<["Request"]>; requestId: Schema.Schema; address: typeof import("./EntityAddress.js").EntityAddress; tag: typeof Schema.String; payload: typeof Schema.Unknown; headers: Schema.Schema>; traceId: Schema.optional; spanId: Schema.optional; sampled: Schema.optional; }>; persisted: typeof Schema.Boolean; }>, Schema.Schema, Reply.ReplyEncoded, never>, Schema.Union<[typeof EntityNotAssignedToRunner, typeof MailboxFull, typeof AlreadyProcessingMessage]>, never> | Rpc.Rpc<"Stream", Schema.Struct<{ request: Schema.Struct<{ _tag: Schema.Literal<["Request"]>; requestId: Schema.Schema; address: typeof import("./EntityAddress.js").EntityAddress; tag: typeof Schema.String; payload: typeof Schema.Unknown; headers: Schema.Schema>; traceId: Schema.optional; spanId: Schema.optional; sampled: Schema.optional; }>; persisted: typeof Schema.Boolean; }>, RpcSchema.Stream, Reply.ReplyEncoded, never>, Schema.Union<[typeof EntityNotAssignedToRunner, typeof MailboxFull, typeof AlreadyProcessingMessage]>>, typeof Schema.Never, never> | Rpc.Rpc<"Envelope", Schema.Struct<{ envelope: Schema.Union<[typeof Envelope.AckChunk, typeof Envelope.Interrupt]>; persisted: typeof Schema.Boolean; }>, typeof Schema.Void, Schema.Union<[typeof EntityNotAssignedToRunner, typeof MailboxFull, typeof AlreadyProcessingMessage]>, never>>; /** * @since 1.0.0 * @category Rpcs */ export declare class Rpcs extends Rpcs_base { } /** * @since 1.0.0 * @category Rpcs */ export interface RpcClient extends RpcClient_.FromGroup { } /** * @since 1.0.0 * @category Rpcs */ export declare const makeRpcClient: Effect.Effect; /** * @since 1.0.0 * @category constructors */ export declare const makeRpc: Effect.Effect; /** * @since 1.0.0 * @category Layers */ export declare const layerRpc: Layer.Layer; declare const RpcClientProtocol_base: Context.TagClass Effect.Effect>; /** * @since 1.0.0 * @category Client */ export declare class RpcClientProtocol extends RpcClientProtocol_base { } export {}; //# sourceMappingURL=Runners.d.ts.map