@laserware/stasis
    Preparing search index...

    Interface Buffer<T>

    Used to implement the buffering strategy for a channel. The Buffer interface defines 3 methods: isEmpty, put and take

    interface Buffer<T> {
        isEmpty(): boolean;
        put(message: T): void;
        take(): undefined | T;
    }

    Type Parameters

    • T
    Index

    Methods

    Methods

    • Returns true if there are no messages on the buffer. A channel calls this method whenever a new taker is registered

      Returns boolean

    • Used to put new message in the buffer. Note the Buffer can choose to not store the message (e.g. a dropping buffer can drop any new message exceeding a given limit)

      Parameters

      • message: T

      Returns void

    • used to retrieve any buffered message. Note the behavior of this method has to be consistent with isEmpty

      Returns undefined | T