NATSSubscriber overview
Added in v0.3.0
Table of contents
constructors
fromSubscription
Create a NATSSubscriber from an existing NATSSubscription.
Note: NATS Core subscriptions are fire-and-forget. Messages are not persisted and there is no acknowledgment mechanism. If the handler fails or times out, the message is lost.
Signature
export declare const fromSubscription: (
subscription: NATSSubscription.NATSSubscription,
options?: NATSSubscriberOptions
) => Effect.Effect<NATSSubscriber, NATSError.NATSConnectionError, NATSConnection.NATSConnection>
Added in v0.3.0
make
Create a NATSSubscriber by subscribing to a subject.
This is a convenience constructor that internally calls subscribe() on the connection.
Note: NATS Core subscriptions are fire-and-forget. Messages are not persisted and there is no acknowledgment mechanism. If the handler fails or times out, the message is lost.
Signature
export declare const make: (
subject: string,
subscriptionOptions?: NATSCore.SubscriptionOptions,
options?: NATSSubscriberOptions
) => Effect.Effect<NATSSubscriber, NATSError.NATSConnectionError, NATSConnection.NATSConnection>
Added in v0.3.0
models
NATSSubscriber (interface)
Signature
export interface NATSSubscriber extends Subscriber.Subscriber<void, NATSMessage.NATSMessage> {
readonly [TypeId]: TypeId
}
Added in v0.3.0
NATSSubscriberOptions (interface)
Signature
export interface NATSSubscriberOptions {
uninterruptible?: boolean
handlerTimeout?: Duration.DurationInput
}
Added in v0.3.0
type ids
TypeId
Signature
export declare const TypeId: typeof TypeId
Added in v0.3.0
TypeId (type alias)
Signature
export type TypeId = typeof TypeId
Added in v0.3.0