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

PoisonPill overview

Added in v1.0.0


Table of contents


constructors

make

Constructs a new PosionPill

Signature

export declare const make: Effect.Effect<PoisonPill>

Added in v1.0.0

models

PoisonPill (class)

A PoisonPill is a special value that tells a behaviour entity to shut itself down. PoisonPill is handled only when you are using a Queue-based RecipientBehaviour. Other RecipientBehaviour such as fromFunctionEffect would not care about PoisonPill.

Signature

export declare class PoisonPill

Added in v1.0.0

schema

schema

This is the schema for a PoisonPill that is used to encode the value over the wire. This is useful if you want a behavior that can be shut down from an external message.

Signature

export declare const schema: Schema.Schema<PoisonPill, PoisonPill.Encoded>

Added in v1.0.0

symbols

PoisonPillTypeId

Signature

export declare const PoisonPillTypeId: typeof PoisonPillTypeId

Added in v1.0.0

PoisonPillTypeId (type alias)

Signature

export type PoisonPillTypeId = typeof PoisonPillTypeId

Added in v1.0.0

utils

PoisonPill (namespace)

Added in v1.0.0

Encoded (interface)

This is the shape that a PoisonPill takes over the wire.

Signature

export interface Encoded extends Schema.Schema.Encoded<typeof PoisonPill> {}

Added in v1.0.0

isPoisonPill

Checks if the given value is a PoisonPill.

Signature

export declare function isPoisonPill(value: unknown): value is PoisonPill

Added in v1.0.0

takeOrInterrupt

Attempts to take a message from the queue in the same way Queue.take does. If the result is a PoisonPill, it will interrupt the effect.

Signature

export declare function takeOrInterrupt<Req>(dequeue: Queue.Dequeue<Req | PoisonPill>): Effect.Effect<Req>

Added in v1.0.0