Skip to content

Commit 828ff1d

Browse files
📘 DOCS: Update
1 parent b104857 commit 828ff1d

File tree

2 files changed

+23
-3
lines changed

2 files changed

+23
-3
lines changed

‎README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
```python
1919
pip install upy-rabbitmq
20-
2120
```
2221

2322
## Config
@@ -29,6 +28,7 @@ RABBITMQ_URL=amqp://user:[email protected]:port//vhost
2928
```
3029

3130
## Callback Class
31+
> callback.py
3232
3333
```python
3434

@@ -43,6 +43,7 @@ class MyCallBack(CallbackProcess):
4343
```
4444

4545
## Start Queue
46+
> worker.py
4647
4748
```python
4849

@@ -56,6 +57,7 @@ worker.start_queue(
5657
```
5758

5859
## New Task
60+
> client.py
5961
6062
```python
6163
from upy_rabbitmq.client import UpyMQClient

‎docs/index.md

+20-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Upy-RabbitMQ
1+
# upy-rabbitmq
22

33
![GitHub Org's stars](https://img.shields.io/github/stars/UpyExplorer?label=LinuxProfile&style=flat-square)
44
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/upy-rabbitmq)
@@ -27,19 +27,37 @@ Add an environment variation called **RABBITMQ_URL** in your project's .env file
2727
RABBITMQ_URL=amqp://user:[email protected]:port//vhost
2828
```
2929

30+
## Callback Class
31+
> callback.py
32+
33+
```python
34+
35+
import time
36+
from upy_rabbitmq.callback import CallbackProcess
37+
38+
class MyCallBack(CallbackProcess):
39+
40+
def process(self):
41+
time.sleep(5)
42+
print(self.body.decode())
43+
```
44+
3045
## Start Queue
46+
> worker.py
47+
3148
```python
3249

3350
from upy_rabbitmq.worker import UpyMQWorker
3451

3552
worker = UpyMQWorker()
3653
worker.start_queue(
3754
key="key",
38-
callback=callback
55+
callback=MyCallBack
3956
)
4057
```
4158

4259
## New Task
60+
> client.py
4361
4462
```python
4563
from upy_rabbitmq.client import UpyMQClient

0 commit comments

Comments
 (0)