Skip to content

Latest commit

 

History

History
24 lines (19 loc) · 1.3 KB

README.md

File metadata and controls

24 lines (19 loc) · 1.3 KB

Central Messaging Queue Minus One

In-memory central messaging queue for dummies

GitHub Actions Workflow Status GitHub repo size GitHub go.mod Go version (subdirectory of monorepo) Codecov

Introduction

Sometimes you want to test your code with mocks and here is a mock for messaging queue. It tries to mimic the NATS concepts and for sure it cannot. It doesn't have any dependencies except Go standard libraries, and you can easily use it in your tests.

mmq := cmq.NewMockMessageQueue[int]()

// register two different subscribing groups.
// create a subscribe groip on "numbers" topic which is named "s1"
mmq.Register("s1", "numbers", 10)
// create a subscribe groip on "numbers" topic which is named "s2"
mmq.Register("s2", "numbers", 10)