Skip to content

Commit

Permalink
update: readme
Browse files Browse the repository at this point in the history
  • Loading branch information
amirhnajafiz committed Aug 19, 2022
1 parent b108c70 commit 95de2cf
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 2 deletions.
32 changes: 30 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,30 @@
# stallion-python-sdk
Client sdk for Stallion message broker.
# Stallion Python SDK

Client SDK for **Stallion** message broker.

## How to use?
### Client
Create a client:
```python
from client import Client

c = Client(url="localhost:9090")
```

### Publish
```python
c.Publish("book", {'author': "Amirhossein", 'name': "Stallion"})
```

### Subscribe
```python
def handler(data):
print(data)

c.Subscribe("book", handler)
```

### Unsubscribe
```python
c.Unsubscribe("book")
```
3 changes: 3 additions & 0 deletions test.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,6 @@ def handler(data):

# publish messages over a topic
c.Publish("book", {'author': "Amirhossein", 'name': "Stallion"})

# unsubscribe
c.Unsubscribe("book")

0 comments on commit 95de2cf

Please sign in to comment.