File tree Expand file tree Collapse file tree 2 files changed +33
-2
lines changed Expand file tree Collapse file tree 2 files changed +33
-2
lines changed Original file line number Diff line number Diff line change 1
- # stallion-python-sdk
2
- Client sdk for Stallion message broker.
1
+ # Stallion Python SDK
2
+
3
+ Client SDK for ** Stallion** message broker.
4
+
5
+ ## How to use?
6
+ ### Client
7
+ Create a client:
8
+ ``` python
9
+ from client import Client
10
+
11
+ c = Client(url = " localhost:9090" )
12
+ ```
13
+
14
+ ### Publish
15
+ ``` python
16
+ c.Publish(" book" , {' author' : " Amirhossein" , ' name' : " Stallion" })
17
+ ```
18
+
19
+ ### Subscribe
20
+ ``` python
21
+ def handler (data ):
22
+ print (data)
23
+
24
+ c.Subscribe(" book" , handler)
25
+ ```
26
+
27
+ ### Unsubscribe
28
+ ``` python
29
+ c.Unsubscribe(" book" )
30
+ ```
Original file line number Diff line number Diff line change @@ -23,3 +23,6 @@ def handler(data):
23
23
24
24
# publish messages over a topic
25
25
c .Publish ("book" , {'author' : "Amirhossein" , 'name' : "Stallion" })
26
+
27
+ # unsubscribe
28
+ c .Unsubscribe ("book" )
You can’t perform that action at this time.
0 commit comments