pamoja for TypeScript - v0.2.0
    Preparing search index...

    Class EventPublisher

    A publish-only handle to an event bus.

    It has no queue of its own, so a part that only announces never fills a buffer it does not read, and publishing from it returns how many subscribers the event was handed to.

    Index
    • Creates a bus with no subscribers yet, and a publisher on it.

      Parameters

      • Optionalcapacity: number | null

        how many events a slow subscriber may fall behind before it starts missing them, rounded up to the next power of two and at most 1048576; 64 when not given.

      Returns bus.EventPublisher

    • Hands an event to every current subscriber: bytes, or text such as an event name.

      It never waits.

      Parameters

      • event: string | Buffer<ArrayBufferLike>

      Returns number

      How many subscribers the event was handed to; an event published while no one is subscribed is dropped, and this is 0.