Skip to main content
Home
This release is 1 version behind 0.3.1 — the latest version of @upyo/pool. Jump to latest

@upyo/pool@0.3.0-dev.36+e7618f03
Built and signed on GitHub Actions

Pool transport for Upyo email library—provides load balancing and failover for multiple email providers

This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
This package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
This package works with Browsers
JSR Score
100%
Published
2 months ago (0.3.0-dev.36+e7618f03)
class WeightedStrategy
implements Strategy

Weighted strategy that distributes traffic based on configured weights.

This strategy uses weighted random selection to distribute messages across transports proportionally to their configured weights. A transport with weight 2 will receive approximately twice as many messages as a transport with weight 1.

Methods

reset(): void

Resets the strategy (no-op for weighted strategy as it's stateless).

select(
_message: Message,
transports: readonly ResolvedTransportEntry[],
attemptedIndices: Set<number>,
): TransportSelection | undefined

Selects a transport based on weighted random distribution.

New Ticket: Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@upyo/pool

Import symbol

import { WeightedStrategy } from "@upyo/pool";
or

Import directly with a jsr specifier

import { WeightedStrategy } from "jsr:@upyo/pool";

Add Package

pnpm i jsr:@upyo/pool
or (using pnpm 10.8 or older)
pnpm dlx jsr add @upyo/pool

Import symbol

import { WeightedStrategy } from "@upyo/pool";

Add Package

yarn add jsr:@upyo/pool
or (using Yarn 4.8 or older)
yarn dlx jsr add @upyo/pool

Import symbol

import { WeightedStrategy } from "@upyo/pool";

Add Package

vlt install jsr:@upyo/pool

Import symbol

import { WeightedStrategy } from "@upyo/pool";

Add Package

npx jsr add @upyo/pool

Import symbol

import { WeightedStrategy } from "@upyo/pool";

Add Package

bunx jsr add @upyo/pool

Import symbol

import { WeightedStrategy } from "@upyo/pool";