Skip to content

Commit

Permalink
chore: update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
1995parham committed Sep 6, 2024
1 parent 6d98470 commit ba637e6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@
## 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.
and for sure it cannot. It doesn't have any dependencies except Go standard libraries, and you can easily use it in your tests.

```go
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)
```

0 comments on commit ba637e6

Please sign in to comment.