Go simple async message bus

Overview

🚌 message-bus

Build Status Go Report Card codecov FOSSA Status license

logo

Go simple async message bus.

📖 ABOUT

Contributors:

Want to contribute ? Feel free to send pull requests!

Have problems, bugs, feature ideas? We are using the github issue tracker to manage them.

📚 Documentation

For documentation (including examples), visit rafallorenz.com/message-bus

For GoDoc reference, visit pkg.go.dev

🚏 HOW TO USE

🚅 Benchmark

➜  message-bus git:(master) ✗ go test -bench=. -cpu=4 -benchmem
goos: darwin
goarch: amd64
pkg: github.com/vardius/message-bus
BenchmarkPublish-4                   	 4430224	       250 ns/op	       0 B/op	       0 allocs/op
BenchmarkSubscribe-4                 	  598240	      2037 ns/op	     735 B/op	       5 allocs/op

👉 Click here to see all benchmark results.

Features

🚏 HOW TO USE

📜 License

This package is released under the MIT license. See the complete license in the package:

FOSSA Status

Issues
  • The website example needs a change to work in playground

    The website example needs a change to work in playground

    The "message-bus" import is eliminated when ran from play.golang.org, as it doesn't match the package name as used by the code. It needs to be aliases, as in https://play.golang.org/p/U5nstd936qf

    opened by fgm 9
  • Could you keep the 'v1.0.0' interface?

    Could you keep the 'v1.0.0' interface?

    I like the new interface. Really, I used the semaphore to control concurrency outside the bus. And, I hope to keeps both the old interface and the new interface.

    • There is the code that depends on the old interface.
    • The new interface has a concern as performance is degraded. https://github.com/vardius/message-bus/blob/master/README.md#benchmark

    v1.0.0 https://github.com/vardius/message-bus/blob/c1f01b61c37e8992775c53d6be6b61e362adfce2/bus.go#L82

    v1.1.0 https://github.com/vardius/message-bus/blob/bdb2394d9af1cf4f226490d32a6cb4e8f6d36ab7/bus.go#L93

    Ref: https://github.com/vardius/message-bus/commit/dd40db9f8e8a2cfe434fdc9381202827f851c931#diff-ecf9c6bcdc8d97b7f04226e8857c1108L82

    opened by michilu 5
  • Add license scan report and status

    Add license scan report and status

    Your FOSSA integration was successful! Attached in this PR is a badge and license report to track scan status in your README.

    Below are docs for integrating FOSSA license checks into your CI:

    opened by fossabot 3
  • subscriber process event asyncly

    subscriber process event asyncly

    I merged it https://github.com/vardius/message-bus/pull/6 but have to think about it if this is an improvement or not, it increases allocations number plus if the number of subscribers is high it actually slows down

    before

    BenchmarkPublish-4                   	 5214352	       226 ns/op	       0 B/op	       0 allocs/op
    BenchmarkSubscribe-4                 	  632084	      3319 ns/op	     730 B/op	       5 allocs/op
    Benchmark1Subscriber1Topic-4         	 5545311	       225 ns/op	       0 B/op	       0 allocs/op
    Benchmark1Subscriber100Topics-4      	 2261838	       808 ns/op	       0 B/op	       0 allocs/op
    Benchmark100Subscribers1Topic-4      	   61615	     19539 ns/op	       0 B/op	       0 allocs/op
    Benchmark100Subscribers100Topics-4   	   60561	     34031 ns/op	       0 B/op	       0 allocs/op
    

    after

    BenchmarkPublish-4                   	  598759	      1981 ns/op	       2 B/op	       0 allocs/op
    BenchmarkSubscribe-4                 	 1000000	      4218 ns/op	     725 B/op	       4 allocs/op
    Benchmark1Subscriber1Topic-4         	  629875	      1899 ns/op	      13 B/op	       0 allocs/op
    Benchmark1Subscriber100Topics-4      	  621306	      1935 ns/op	       0 B/op	       0 allocs/op
    Benchmark100Subscribers1Topic-4      	    6942	    206815 ns/op	    3343 B/op	       8 allocs/op
    Benchmark100Subscribers100Topics-4   	    6996	    320923 ns/op	    8107 B/op	      16 allocs/op
    

    Originally posted by @vardius in https://github.com/vardius/message-bus/pull/6#issuecomment-651752332

    Did not release new version yet, will think about it and either revert or release would love to hear second opinion about it.

    	go func() {
     		for args := range h.queue {
    - 			h.callback.Call(args)
    +		 	go func(targs []reflect.Value) {
    + 				h.callback.Call(targs)
    + 			}(args)
     		}
     	}()
    

    Personally I think it is up to a developer of a handler to execute his callback in a goroutine or not, up to him and the package itself should not enforce goroutine here. cc @me020523

    opened by vardius 1
  • How does this compare with systems like Kafka and RabbitMQ?

    How does this compare with systems like Kafka and RabbitMQ?

    How does this library compare with the usage of systems like Kafka and RabbitMQ as message transporters? Particularly in terms of performance and security.

    Edit: just took a look at the code, it seems like this library doesn't do what I thought. So is it accurate to say that it's a sync RWMutex wrapper utility? How can one use it to establish connection between microservices, if at all possible?

    opened by omerdn1 1
Releases(v1.1.5)
🔊Minimalist message bus implementation for internal communication

?? Bus Bus is a minimalist event/message bus implementation for internal communication. It is heavily inspired from my event_bus package for Elixir la

Mustafa Turan 266 Jun 16, 2022
GTA(Go Task Async) is a lightweight reliable asynchronous task and transaction message library for Golang

GTA (Go Task Async) is a lightweight and reliable asynchronous task and transaction message library for by golang.

Kevin Su 12 Jun 4, 2022
Alertmanager go message broker - A simple message broker made to integrate with alertmanager/prometheus

Alertmanager message broker Prerequisites Go 1.16+ Sqllite driver About: The alertmanager message broker is a project made to meet some of my needs to

Davi Araújo 0 Dec 27, 2021
Native Go bindings for D-Bus

dbus dbus is a simple library that implements native Go client bindings for the D-Bus message bus system. Features Complete native implementation of t

null 717 Jun 22, 2022
[Go] Lightweight eventbus with async compatibility for Go

EventBus Package EventBus is the little and lightweight eventbus with async compatibility for GoLang. Installation Make sure that Go is installed on y

Alex Saskevich 1.2k Jun 29, 2022
Gin best practices, gin development scaffolding, too late to explain, get on the bus.

Table of Contents generated with DocToc gin_scaffold 现在开始 文件分层 log / redis / mysql / http.client 常用方法 swagger文档生成 gin_scaffold Gin best practices, gin

niuyufu 510 Jun 19, 2022
Easy to use distributed event bus similar to Kafka

chukcha Easy to use distributed event bus similar to Kafka. The event bus is designed to be used as a persistent intermediate storage buffer for any k

Yuriy Nasretdinov 71 Jun 8, 2022
Govent is an event bus framework for DDD event source implement

Govent is an event bus framework for DDD event source implement. Govent can also solve the package circular dependency problem.

Michaelyn 2 Jan 28, 2022
A single binary, simple, message queue.

MiniQueue A stupid simple, single binary message queue using HTTP/2. Most messaging workloads don't require enormous amounts of data, endless features

Tom Arrell 101 Jun 18, 2022
Simple docker container to publish a fixed message to a specified queue. Created to be used with k8s CRON scheduling.

RabbitMQ Publish CRON Simple docker container to publish a fixed message to a specified rabbitmq exchange. Created to be used as part of a Kubernetes

Daniel Emery 0 Dec 20, 2021
An n:m message multiplexer written in Go

What is Gollum? Gollum is an n:m multiplexer that gathers messages from different sources and broadcasts them to a set of destinations. Gollum origina

trivago N.V. 919 Jun 21, 2022
A library for scheduling when to dispatch a message to a channel

gosd go-schedulable-dispatcher (gosd), is a library for scheduling when to dispatch a message to a channel. Implementation The implementation provides

Alexander Sniffin 19 Jan 23, 2022
:incoming_envelope: A fast Message/Event Hub using publish/subscribe pattern with support for topics like* rabbitMQ exchanges for Go applications

Hub ?? A fast enough Event Hub for go applications using publish/subscribe with support patterns on topics like rabbitMQ exchanges. Table of Contents

Leandro Lugaresi 115 Apr 8, 2022
Machinery is an asynchronous task queue/job queue based on distributed message passing.

Machinery Machinery is an asynchronous task queue/job queue based on distributed message passing. V2 Experiment First Steps Configuration Lock Broker

Richard Knop 6.3k Jun 29, 2022
The Xiaomi message push service is a system-level channel on MIUI and is universal across the platform, which can provide developers with stable, reliable, and efficient push services.

Go-Push-API MiPush、JiPush、UMeng MiPush The Xiaomi message push service is a system-level channel on MIUI and is universal across the platform, which c

houseme 4 Jun 25, 2022
GopherSay allow you to display a message said by a cute random Gopher.

GopherSay About Welcome in GopherSay! GopherSay is inspired by Cowsay program. GopherSay allow you to display a message said by a cute random Gopher.

Aurelie Vache 16 Mar 7, 2022
Golang module/tool for decoding proto buffer without message definition.

Golang module/tool for decoding proto buffer without message definition.

null 32 Jun 23, 2022
Testing message queues with RabbitMQ

Rabbit-MessageQueue Just a repository of RabbitMQ simple usage for queueing messages. You can use this as a sender or a receiver. More information is

Jawady Muhammad Habib 2 Mar 10, 2022
Distributed Lab 3: Message Broker in Go

Distributed Lab 3: Message Broker in Go Using the lab sheet There are two ways to use the lab sheet, you can either: create a new repo from this templ

null 0 Oct 29, 2021