Popularity
4.4
Growing
Activity
5.7
Declining
88
4
16

Programming language: Go
Tags: Messaging    
Latest version: v1.1.4

messagebus alternatives and similar packages

Based on the "Messaging" category

Do you think we are missing an alternative of messagebus or a related project?

Add another 'Messaging' Package

README

🚌 message-bus

Build Status Go Report Card codecov FOSSA Status license

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 godoc.org/github.com/vardius/message-bus

🚏 HOW TO USE

πŸš… Benchmark

Time complexity of a Publish method is considered to be linear time O(n). Where n corresponds to the number of subscribers for a given topic.

CPU: 3,3 GHz Intel Core i7

RAM: 16 GB 2133 MHz LPDDR3

➜  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

🏫 Basic example

package main

import (
    "fmt"
    "sync"

    "github.com/vardius/message-bus"
)

func main() {
    queueSize := 100
    bus := messagebus.New(queueSize)

    var wg sync.WaitGroup
    wg.Add(2)

    _ = bus.Subscribe("topic", func(v bool) {
        defer wg.Done()
        fmt.Println(v)
    })

    _ = bus.Subscribe("topic", func(v bool) {
        defer wg.Done()
        fmt.Println(v)
    })

    // Publish block only when the buffer of one of the subscribers is full.
    // change the buffer size altering queueSize when creating new messagebus
    bus.Publish("topic", true)
    wg.Wait()
}

🐳 Docker service

pubsub - gRPC message-oriented middleware on top of message-bus, event ingestion and delivery system.

πŸ“œ [License](LICENSE.md)

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

FOSSA Status


*Note that all licence references and agreements mentioned in the messagebus README section above are relevant to that project's source code only.