Skip to main content Link Search Menu Expand Document (external link)

AtLeastOnceStorage overview

Added in v1.0.0


Table of contents


context

AtLeastOnceStorage

Signature

export declare const AtLeastOnceStorage: Tag<AtLeastOnceStorage, AtLeastOnceStorage>

Added in v1.0.0

layer

Signature

export declare const layer: (
  options: AtLeastOnceStorage.MakeOptions
) => Layer<AtLeastOnceStorage, SqlError, SqlClient | Serialization>

Added in v1.0.0

models

AtLeastOnceStorage (interface)

Signature

export interface AtLeastOnceStorage extends AtLeastOnceStorage.Proto {
  /**
   * Upserts a message into the storage, eventually returning the already
   * existing message state as result in the storage.
   */
  upsert<Msg extends Message.Any>(
    recipientType: RecipientType<Msg>,
    shardId: ShardId,
    entityId: string,
    message: Msg
  ): Effect<void>

  /**
   * Marks the specified message as processed to prevent additional attempts to
   * send the message.
   */
  markAsProcessed<Msg extends Message.Any>(
    recipientType: RecipientType<Msg>,
    shardId: ShardId,
    entityId: string,
    message: Msg
  ): Effect<void>

  /**
   * Returns a stream of messages that will be sent to the local pod as a second
   * attempt.
   */
  sweepPending(shardIds: Iterable<ShardId>): Stream<SerializedEnvelope>
}

Added in v1.0.0

symbols

TypeId

Signature

export declare const TypeId: typeof TypeId

Added in v1.0.0

TypeId (type alias)

Signature

export type TypeId = typeof TypeId

Added in v1.0.0

utils

AtLeastOnceStorage (namespace)

Added in v1.0.0

MakeOptions (interface)

Signature

export interface MakeOptions {
  readonly table: string
}

Added in v1.0.0

Proto (interface)

Signature

export interface Proto {
  readonly [TypeId]: TypeId
}

Added in v1.0.0