GithubHelp home page GithubHelp logo

nixbus / event-bus Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 848 KB

Secure, robust, and efficient event bus over HTTP/In-memory.

Home Page: https://nixbus.com

License: MIT License

TypeScript 98.09% JavaScript 1.91%
domainevents event-driven event-sourcing eventbus pubsub queue

event-bus's Introduction

NixBus Event Bus

NixBus Event Bus is a secure, robust, and efficient event bus over HTTP. This JavaScript SDK allows you to integrate NixBus into your applications seamlessly, enabling decoupled event-driven architectures. Ideal for microservices, this SDK supports event publishing, subscribing, and processing with ease.

Features

  • Simple Integration: Easily add NixBus to your project using NixBus NPM package.
  • Secure Communication: End-to-end encryption ensures your event data is safe.
  • Scalable: Handle events across multiple microservices and locations.
  • In-Memory Option: Use the in-memory event bus for smaller applications.
  • Detailed Monitoring: Monitor your event usage and system performance in real-time via NixBus dashboard.

Installation

To install the NixBus Event Bus SDK, run the following command:

npm install @nixbus/event-bus --save -E

Usage

Subscribing to Events and running the event bus

import { getHttpNixBus } from '@nixbus/event-bus'

const nixbus = getHttpNixBus({
  token: 'your_token',
  passphrase: 'your_passphrase',
})

await nixbus.subscribe('event_type', {
  id: 'a_subscriber_id',
  action: async (event) => {
    console.log('Received event:', event)
    // Process the event
  },
  config: { maxRetries: 3, timeout: 10, concurrency: 500 },
})

nixbus.run()

Publishing events

import { getHttpNixBus } from '@nixbus/event-bus'

const nixbus = getHttpNixBus({
  token: 'your_token',
  passphrase: 'your_passphrase',
})

await nixbus.publish({
  type: 'event_type',
  payload: { welcome: 'to the event bus' },
})

Examples

Check out the examples folder for more usage examples. These examples can help you test and understand how to implement NixBus in your projects.

API Documentation

For more detailed information on using the NixBus HTTP API, or if you want to create your own implementation or build SDKs in other languages, please refer to NixBus API documentation.

event-bus's People

Contributors

dreyacosta avatar

Stargazers

leyle avatar pd avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.