def runRedisServer(port=6379):
"""runs redis-server"""
# waits until it can accept client connection by reading its all
# startup messages until it says 'ready to accept ...', then
# redirect any following output to DEVNULL.
port = str(port)
server = subprocess.Popen(['redis-server', '--port', port],
stdout=subprocess.PIPE,
universal_newlines=True)
message = _REDIS_READY_MESSAGE + port
while message not in server.stdout.readline():
pass
dumper = subprocess.Popen(['cat'],
stdin=server.stdout,
stdout=subprocess.DEVNULL)
return server, dumper
test_redisrwlock_connection.py 文件源码
python
阅读 24
收藏 0
点赞 0
评论 0
评论列表
文章目录