重新思考数据库作业队列
tqueues的Python项目详细描述
tqueues
Tqueues(重新思考数据库队列)是一个简单的python3.5+ 用于将作业排队并使用RethinkDB在工人中处理它们的库。
功能
- 接受coroutines作为作业
- 分布
- 处理rethinkdb数据库对象中可重用的所有内容 在工人那里
- 通过websockets公开更改
- 使用RethinkDB流媒体“更改”方法,wich非常高效
- 使用Asyncio,为作业实现异步上下文管理器,并 工人的异步迭代器
+--> Worker | Rethindb --> Dispatcher ---> Worker | +--> Worker
用法
Tqueues提供两个入口点,Tqueueues_Dispatcher和Tqueueues_Worker。
Tqueues Dispatcher必须可从所有工人访问,并且您需要启动 每个并行任务需要一个工人。它们可以被分发(只要 他们可以联系调度员)
工人
Usage: tqueues_worker -h | --help tqueues_worker --version tqueues_worker --endpoint_url <endpoint_url> tqueues_worker --queue <queue> Options: -h --help Show this screen -v --version Show version --endpoint_url <ENDPOINT_URL> TQueues dispatcher endpoint --queue <QUEUE> Endpoint queue to listen on Examples: tqueues_worker --endpoint_url http://127.0.0.1:800/ --queue testqueue
Tqueues作业调度程序
Usage: tqueues_dispatcher --db "db" --host "127.0.0.1" --port 28015 tqueues_dispatcher --db "db" --host "127.0.0.1" tqueues_dispatcher --db "db" --port 28015 tqueues_dispatcher --db "db" --user 'user' tqueues_dispatcher --db "db" --password 'password' tqueues_dispatcher -h | --help tqueues_dispatcher --version Options: --host "127.0.0.1" Rethinkdb host --db "db" Rethinkdb databaes --port 28015 Rethinkdb port --user 'user' Rethinkdb user --password 'password' Rethinkdb password --allowed_domains 'foo.com,bar.com' Allowed domains --loglevel (DEBUG|INFO) Loglevel -h --help Show this screen --version Show version Examples: tqueues_dispatcher --host localhost --db foo --port 28015 --user foo --password bar --loglevel INFO --allowed_domains 'foo.com,bar.com'