File tree 2 files changed +14
-12
lines changed
2 files changed +14
-12
lines changed Original file line number Diff line number Diff line change @@ -37,17 +37,19 @@ rpc.listen()
37
37
``` python
38
38
import os
39
39
from redisrpc import RedisRPC
40
- # Add REDIS_URI application enviroment variable
40
+
41
+ # Add REDIS_URI application enviroment
41
42
42
43
os.environ.setdefault(" REDIS_URI" , " redis://localhost:6379/0" )
43
44
44
- pub = RedisRPC(" channel_name" ) # channel name must be same as server
45
- square = pub .send(" square" , 5 ) # send data to spesific event
46
- cube = pub .send(" cube" , 3 )
45
+ rpc = RedisRPC(" channel_name" ) # channel name must be same as server
46
+ square = rpc .send(" square" , 5 ) # send data to spesific event
47
+ cube = rpc .send(" cube" , 3 )
47
48
48
49
# response from server handlers
49
- print (square) # 25
50
- print (cube) # 27
50
+ print (square) # 25
51
+ print (cube) # 27
52
+
51
53
```
52
54
53
55
# Contributing
Original file line number Diff line number Diff line change 1
1
import os
2
2
from redisrpc import RedisRPC
3
+
3
4
# Add REDIS_URI application enviroment
4
5
5
6
os .environ .setdefault ("REDIS_URI" , "redis://localhost:6379/0" )
6
7
7
- pub = RedisRPC ("channel_name" ) # channel name must be same as listener
8
- square = pub .send ("square" , 5 ) # send data to spesific event
9
- cube = pub .send ("cube" , 3 )
8
+ rpc = RedisRPC ("channel_name" ) # channel name must be same as server
9
+ square = rpc .send ("square" , 5 ) # send data to spesific event
10
+ cube = rpc .send ("cube" , 3 )
10
11
11
12
# response from server handlers
12
- print (square ) # 25
13
- print (cube ) # 27
14
-
13
+ print (square ) # 25
14
+ print (cube ) # 27
You can’t perform that action at this time.
0 commit comments