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

Consumer overview

Added in v0.1.0


Table of contents


accessors

serve

Signature

export declare const serve: {
  (
    options: Consumer.ConsumerOptions
  ): <E, R>(
    app: MessageRouter.MessageRouter<E, R>
  ) => Layer.Layer<
    never,
    Error.ConnectionException,
    KafkaInstance.KafkaInstance | Exclude<R, ConsumerRecord.ConsumerRecord | Scope.Scope>
  >
  <E, R>(
    app: MessageRouter.MessageRouter<E, R>,
    options: Consumer.ConsumerOptions
  ): Layer.Layer<
    never,
    Error.ConnectionException,
    KafkaInstance.KafkaInstance | Exclude<R, ConsumerRecord.ConsumerRecord | Scope.Scope>
  >
}

Added in v0.1.0

serveEffect

Signature

export declare const serveEffect: {
  (
    options: Consumer.ConsumerOptions
  ): <E, R>(
    app: MessageRouter.MessageRouter<E, R>
  ) => Effect.Effect<
    void,
    Error.ConnectionException,
    Scope.Scope | KafkaInstance.KafkaInstance | Exclude<R, ConsumerRecord.ConsumerRecord>
  >
  <E, R>(
    app: MessageRouter.MessageRouter<E, R>,
    options: Consumer.ConsumerOptions
  ): Effect.Effect<
    void,
    Error.ConnectionException,
    Scope.Scope | KafkaInstance.KafkaInstance | Exclude<R, ConsumerRecord.ConsumerRecord>
  >
}

Added in v0.1.0

serveStream

Signature

export declare const serveStream: (
  path: MessageRouter.Route.Path
) => Stream.Stream<ConsumerRecord.ConsumerRecord, never, Consumer>

Added in v0.3.0

constructors

Consumer

Signature

export declare const Consumer: Context.Tag<Consumer, Consumer>

Added in v0.1.0

make

Signature

export declare const make: (options: {
  readonly run: (app: MessageRouter.MessageRouter) => Effect.Effect<void>
  readonly runStream: (path: MessageRouter.Route.Path) => Stream.Stream<ConsumerRecord.ConsumerRecord>
}) => Consumer

Added in v0.1.0

makeConsumer

Signature

export declare const makeConsumer: (
  options: Consumer.ConsumerOptions
) => Effect.Effect<Consumer, Error.ConnectionException, KafkaInstance.KafkaInstance | Scope.Scope>

Added in v0.3.1

layers

layer

Signature

export declare const layer: (
  options: Consumer.ConsumerOptions
) => Layer.Layer<Consumer, Error.ConnectionException, KafkaInstance.KafkaInstance>

Added in v0.3.1

models

Consumer (interface)

Signature

export interface Consumer {
  readonly [TypeId]: TypeId
  readonly run: {
    <E, R>(
      app: MessageRouter.MessageRouter<E, R>
    ): Effect.Effect<void, never, Exclude<R, ConsumerRecord.ConsumerRecord>>
  }
  readonly runStream: {
    (path: MessageRouter.Route.Path): Stream.Stream<ConsumerRecord.ConsumerRecord>
  }
}

Added in v0.1.0

type ids

TypeId

Signature

export declare const TypeId: typeof TypeId

Added in v0.1.0

TypeId (type alias)

Signature

export type TypeId = typeof TypeId

Added in v0.1.0

utils

Consumer (namespace)

Added in v0.2.0

ConsumerOptions (interface)

Signature

export interface ConsumerOptions extends KafkaJS.ConsumerConfig {}

Added in v0.2.0