Thanks to visit codestin.com
Credit goes to effect-ts.github.io

Skip to main content Codestin Search App Codestin Search App Codestin Search App Codestin Search App Codestin Search App Codestin Search App

PersistedQueue.ts overview

Since v1.0.0


Exports Grouped by Category


Accessors

make

Signature

declare const make: <A, I, R>(options: {
  readonly name: string
  readonly schema: Schema.Schema<A, I, R>
}) => Effect.Effect<PersistedQueue<A, R>, never, PersistedQueueFactory>

Source

Since v1.0.0

Errors

ErrorTypeId

Signature

declare const ErrorTypeId: "~@effect/experimental/PersistedQueue/PersistedQueueError"

Source

Since v1.0.0

ErrorTypeId (type alias)

Signature

type ErrorTypeId = "~@effect/experimental/PersistedQueue/PersistedQueueError"

Source

Since v1.0.0

PersistedQueueError (class)

Signature

declare class PersistedQueueError

Source

Since v1.0.0

[ErrorTypeId] (property)

Signature

readonly [ErrorTypeId]: "~@effect/experimental/PersistedQueue/PersistedQueueError"

Source

Since v1.0.0

Factory

PersistedQueueFactory (class)

Signature

declare class PersistedQueueFactory

Source

Since v1.0.0

layer

Signature

declare const layer: Layer.Layer<PersistedQueueFactory, never, PersistedQueueStore>

Source

Since v1.0.0

makeFactory

Signature

declare const makeFactory: Effect.Effect<
  {
    readonly make: <A, I, R>(options: {
      readonly name: string
      readonly schema: Schema.Schema<A, I, R>
    }) => Effect.Effect<PersistedQueue<A, R>>
  },
  never,
  PersistedQueueStore
>

Source

Since v1.0.0

Models

PersistedQueue (interface)

Signature

export interface PersistedQueue<in out A, out R = never> {
  readonly [TypeId]: TypeId

  /**
   * Adds an element to the queue. Returns the id of the enqueued element.
   *
   * If an element with the same id already exists in the queue, it will not be
   * added again.
   */
  readonly offer: (
    value: A,
    options?: {
      readonly id: string | undefined
    }
  ) => Effect.Effect<string, PersistedQueueError | ParseResult.ParseError, R>

  /**
   * Takes an element from the queue.
   * If the queue is empty, it will wait until an element is available.
   *
   * If the returned effect succeeds, the element is marked as processed,
   * otherwise it will be retried according to the provided options.
   *
   * By default, max attempts is set to 10.
   */
  readonly take: <XA, XE, XR>(
    f: (
      value: A,
      metadata: {
        readonly id: string
        readonly attempts: number
      }
    ) => Effect.Effect<XA, XE, XR>,
    options?: {
      readonly maxAttempts?: number | undefined
    }
  ) => Effect.Effect<XA, XE | PersistedQueueError | ParseResult.ParseError, R | XR>
}

Source

Since v1.0.0

Store

PersistedQueueStore (class)

Signature

declare class PersistedQueueStore

Source

Since v1.0.0

layerStoreMemory

Signature

declare const layerStoreMemory: Layer.Layer<PersistedQueueStore, never, never>

Source

Since v1.0.0

Type IDs

TypeId

Signature

declare const TypeId: "~@effect/experimental/PersistedQueue"

Source

Since v1.0.0

TypeId (type alias)

Signature

type TypeId = "~@effect/experimental/PersistedQueue"

Source

Since v1.0.0