https://github.com/swhl/python-redis-flask-queue
python中利用redis构建任务队列(queue)
https://github.com/swhl/python-redis-flask-queue
Last synced: about 1 month ago
JSON representation
python中利用redis构建任务队列(queue)
- Host: GitHub
- URL: https://github.com/swhl/python-redis-flask-queue
- Owner: SWHL
- Created: 2021-03-01T01:44:12.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2021-03-04T06:45:22.000Z (over 5 years ago)
- Last Synced: 2025-01-25T05:41:26.790Z (over 1 year ago)
- Language: Python
- Size: 1.95 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
#### python-redis-flask-queue
- 利用redis构建任务队列
- 代码来源:[python中利用redis构建任务队列(queue)](https://www.cnblogs.com/arkenstone/p/7813551.html)
#### 文件说明
- `task.py`: rq work进程来监听队列
- `test.py`: 模拟post和get请求
- `app.py`: 搭建flask框架
#### 运行步骤
~~`python worker.py`启动`redis server`~~ 这种方式不能有效执行,目前不清楚问题在哪里?
1. 启动redis
2. `rq worker` 启动`redis server`
3. `python app.py`启动`flask`服务
4. `python test.py`发送post和get请求,打印队列中任务执行结果