This release is 4 versions behind 0.4.0 — the latest version of @upyo/pool. Jump to latest
Built and signed on GitHub ActionsBuilt and signed on GitHub Actions
Built and signed on GitHub Actions
Works with
•JSR Score100%•This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers




Downloads1/wk
•Published2 months ago (0.3.1)
Pool transport for Upyo email library—provides load balancing and failover for multiple email providers
import type { Message } from "jsr:@upyo/core@^0.3.1"; import type { ResolvedTransportEntry } from "../config.ts"; /** * Result of transport selection by a strategy. * @since 0.3.0 */ export interface TransportSelection { /** * The selected transport entry. */ readonly entry: ResolvedTransportEntry; /** * Index of the selected transport in the original list. */ readonly index: number; } /** * Base interface for transport selection strategies. * @since 0.3.0 */ export interface Strategy { /** * Selects a transport for sending a message. * * @param message The message to send. * @param transports Available transports. * @param attemptedIndices Indices of transports that have already been * attempted. * @returns The selected transport or `undefined` if no suitable transport is * available. */ select( message: Message, transports: readonly ResolvedTransportEntry[], attemptedIndices: Set<number>, ): TransportSelection | undefined; /** * Resets any internal state of the strategy. */ reset(): void; }