Skip to content

TinyBus is a highly customizable event bus shipping with different dispatching strategies, retry support, event persistence, event replay and much more.

License

Notifications You must be signed in to change notification settings

fabio-nettis/tiny-bus

Repository files navigation

TinyBus Logo

A tiny and highly customizable event bus. Created to be typesafe out of the box.

Comes with different dispatching strategies, retry support, event peristence, event replay and much more.


Tests Tests Tests Tests

Installation

yarn add tiny-b

Usage

import TinyBus from "tiny-b";

const tinyBus = new TinyBus(/* options */);

const subscriberId = await tinyBus.on("my-event::v1", {
  onCallback: (subscriberId, context, ...args) => {
    console.log("My event", { subscriberId, context, args });
  },
});

await tinyBus.emit("my-event::v1", { foo: "bar" });

FAQ

What is an event bus?

An event bus is a mechanism that allows different parts of an application to communicate with each other without knowing about each other. It is a publish/subscribe system where the publisher of an event (the producer) does not send it directly to the receiver (the consumer), but instead sends it to an event bus. The event bus then distributes the event to all interested consumers.

Why another event bus?

There are many event bus implementations out there, but TinyBus is different. Starting from the fact that it is tiny and has almost no dependencies, it also supports different dispatching strategies, event deduplication and retrying failed events out of the box.

About

TinyBus is a highly customizable event bus shipping with different dispatching strategies, retry support, event persistence, event replay and much more.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published