sanic extensions
awaesome
redis
- sanic-redis-extension(官方文档)
- release版本是2018年的(截止20220415)
- 问题
- 使用sanic 2.21.3版本会提示不兼容的错误
AttributeError: Setting variables on Sanic instances is not allowed. You should change your Sanic instance to use instance.ctx.extensions
instead. - redis配置参数不支持timeout设置
config = {
"address": connection_uri,
"db": self.get_from_app_config(app, 'REDIS_DATABASE', None),
"password": self.get_from_app_config(app, 'REDIS_PASSWORD', None),
"ssl": self.get_from_app_config(app, 'REDIS_SSL', None),
"encoding": self.get_from_app_config(app, 'REDIS_ENCODING', None),
"minsize": self.get_from_app_config(app, 'REDIS_MIN_SIZE_POOL', 1),
"maxsize": self.get_from_app_config(app, 'REDIS_MAX_SIZE_POOL', 10),
}
- sanic-redis
- release版本2021年(截止20220415)
- 连接方式基于url,参数列表
URL_QUERY_ARGUMENT_PARSERS = {
"db": int,
"socket_timeout": float,
"socket_connect_timeout": float,
"socket_keepalive": bool,
"retry_on_timeout": bool,
"max_connections": int,
"health_check_interval": int,
"ssl_check_hostname": bool,
}
sanic-session
- sanic-session
- MemCache