Parex
Parallel Execution for Python
Install / Use
/learn @enki/ParexREADME
parex - Parallel Execution for Python
(c) 2010 by Paul Bohm http://paulbohm.com/
MIT License.
Execute multiple processes in parallel and then wait for all to finish.
I use this for faster deployment with fabric, so commands don't block.
For best results combine with SSH multiplexing (ControlMaster).
Usage (Standalone):
x = TaskManager(cwd=".")
x.execute('ls') # execute commands
x.execute('ps auxw')
pid = x.execute('who') # returns pid
x.wait() # wait till all have finished
for y in x.data.values(): # keyed by pid
print y.getvalue() # y is StringIO
Also integrates nicely with fabric. Instead of doing blocking
with cd("foo/bar"):
run('python bbqctl.py daemon fanoutserver')
run('python bbqctl.py daemon main')
run('python bbqctl.py daemon twitresolve')
run('python bbqctl.py daemon rssparse')
on the fabric client. Just do
x = TaskManager("foo/bar")
x.execute('python bbqctl.py daemon fanoutserver')
x.execute('python bbqctl.py daemon main')
x.execute('python bbqctl.py daemon twitresolve')
x.execute('python bbqctl.py daemon rssparse')
x.wait()
on the server. You can use fabric to make the server run your code.
Related Skills
node-connect
344.4kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
99.2kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
344.4kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
344.4kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
