zaku.server
Task Server

class zaku.server.Flag[source]

Bases: Proto

class zaku.server.Redis[source]

Bases: ParamsProto

Redis Configuration for the TaskServer class.

Setting keepalive: ConnectionError is due to timeout. See below for more infomation.

https://devcenter.heroku.com/articles/ah-redis-stackhero#:~:text=The%20error%20%E2%80%9Credis.,and%20the%20connection%20closes%20automatically

# Put this into an .env file
REDIS_HOST=localhost
REDIS_PORT=6379
REDIS_PASSWORD=xxxxxxxxxxxxxxxxxxx
REDIS_DB=0

CLI Options:

--redis.host      :str 'localhost'
--redis.port      :int 6379
--redis.password  :any None
--redis.db        :any 0
host = 'localhost'
port = 6379
password = None
sentinel_hosts = None
sentinel_password = Proto(default=Proto(default=None, dtype=None, help=':any None ', metavar='\x08'), dtype=<class 'params_proto.proto.Proto'>, help=":Proto Proto(default=None, dtype=None, help=':any... ", metavar='\x08')
cluster_name = 'primary'
shuffle = False
db = 0
health_check_interval = 10
socket_connect_timeout = 5
retry_on_timeout = True
socket_keepalive = True
class zaku.server.TaskServer[source]

Bases: ParamsProto, Server

TaskServer

This is the server that maintains the Task Queue.

Usage

app = TaskServer()
app.run()

CLI Options

python -m zaku.server --help

-h, --help            show this help message and exit
--prefix            :str 'Zaku-task-queues'
--queue-len         :int 100
--host              :str 'localhost'
                      set to 0.0.0.0 to enable remote (not localhost) connections.
--port              :int 9000
--cors              :str 'https://vuer.ai,https://dash.ml,http://lo...
--cert              :str None the path to the SSL certificate
--key               :str None the path to the SSL key
--ca-cert           :str None the trusted root CA certificates
--REQUEST-MAX-SIZE  :int 100000000 the maximum packet size
--free-port         :bool False
                      kill process squatting target port if True.
--static-root       :str '.'
--verbose           :bool False
                      show the list of configurations during launch if True.
prefix = 'Zaku-task-queues'
queue_len = 100
host: str = 'localhost'
port: int = 9000
cors: str = 'https://vuer.ai,https://dash.ml,http://localhost:8000,http://127.0.0.1:8000,*'

Enable CORS

cert: str = None

the path to the SSL certificate

key: str = None

the path to the SSL key

ca_cert: str = None

the trusted root CA certificates

REQUEST_MAX_SIZE = 100000000
free_port = None
static_root = '.'
verbose = None
WEBSOCKET_MAX_SIZE = 268435456
zaku.server.entry_point()[source]
async zaku.server.get_app()[source]

This is sued by gunicorn to run the server in worker mode.