콘텐츠로 이동

NotificationRelayOptions — @gj-kit/nest-notifications

@gj-kit/nest-notifications에서 공개하는 interface입니다. package version 0.1.1의 release declaration을 그대로 표시합니다.

import { NotificationRelayOptions } from '@gj-kit/nest-notifications';
/**
* 릴레이 — ingress outbox 행을 배달로 물질화한다(설계 §3.6).
*
* 소스 로직을 유지하되 저장소 호출만 포트로 바꾼다. 소스와 달라지는 지점은 세 개이고
* 전부 결함 수정이다: 시각을 행마다 다시 읽고(§0.2-⑦), stale 임계를 기간으로만 넘기며
* (R12), `createDelivery`의 `created: false`를 병합/follow-up으로 되돌린다(R11 · §0.3-⑦).
*/
interface NotificationRelayOptions {
readonly applicationKey: string;
readonly store: NotificationRelayStore;
readonly policy: NotificationSchedulingPolicy;
readonly runtime?: NotificationRuntime | undefined;
readonly logger?: NotificationLogger | undefined;
/** Defaults to {@link DEFAULT_RELAY_PAGE_SIZE}. */
readonly pageSize?: number | undefined;
/**
* Passed to the store as a duration; the store compares it against its own
* clock (R12). Defaults to {@link DEFAULT_CLAIM_STALE_MS}.
*/
readonly claimStaleMs?: number | undefined;
/**
* Rows already attempted this many times are left out of the due page (R13).
* Absent means no bound - a permanently failing row is then re-claimed every
* pass and, at `pageSize` such rows, starves healthy notifications (design
* 7-16). The library owns no backoff policy (design 0.4-7); this is the only
* lever it offers, and choosing a value is an operational decision.
*
* **Both settings lose something, so read this before picking one.**
*
* - `attempts` counts *claims*, not elapsed time: there is no cooldown between
* a `releaseClaim` and the next claim, so the retry window this buys is
* `maxAttempts ÷ pass frequency`, not a duration. Every pass counts - a
* periodic runner's and a `NotificationPipelineWakeup` pass alike - so with
* the wakeup hint enabled a staging burst can spend the whole budget of an
* unrelated failing row in seconds.
* - An exhausted row leaves the due page **permanently**, and nothing in this
* package reports it: neither summary type counts it, and the store is asked
* for a filtered page rather than for what it filtered out. Watching for
* exhausted rows is a host query (design 6-15), and a host that does not run
* one converts a transport outage longer than the budget into silent loss.
*/
readonly maxAttempts?: number | undefined;
}

이 선언은 매개변수, optionality, 제네릭, 반환값, 공개 union/type 계약의 정본입니다. 호출 전 필요한 환경·권한·오류 경계는 패키지 Golden path와 이 subpath의 import 조건을 함께 확인하세요.

  • 패키지: @gj-kit/nest-notifications
  • 버전: 0.1.1
  • 공개 entry: .
  • 소스: GitHub

릴레이 — ingress outbox 행을 배달로 물질화한다(설계 §3.6).

소스 로직을 유지하되 저장소 호출만 포트로 바꾼다. 소스와 달라지는 지점은 세 개이고 전부 결함 수정이다: 시각을 행마다 다시 읽고(§0.2-⑦), stale 임계를 기간으로만 넘기며 (R12), createDeliverycreated: false를 병합/follow-up으로 되돌린다(R11 · §0.3-⑦).