Skip to content

Commit 4c25f99

Browse files
committed
Added message sending to readme doccumentation.
1 parent 12a77ba commit 4c25f99

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,16 @@ This is to ensure the program is non-blocking
4747
err := <-eventBus.Listen()
4848
```
4949

50+
## To send a message
51+
Simply state the stream name and a map containing the message data.
52+
``` Go
53+
message := map[string]interface{}{
54+
"user_id": "1a2b3c",
55+
"user_name": "John Doe",
56+
}
57+
eventBus.Send("user.created", message)
58+
```
59+
5060
## To close the instance.
5161
Waits for all messages acquired before closure to be processed or timeout, then closes the listener and connection.
5262
``` Go

0 commit comments

Comments
 (0)