hurricane.management

hurricane.management.commands.serve

class hurricane.management.commands.serve.Command(stdout=None, stderr=None, no_color=False, force_color=False)[source]

Start a Tornado-powered Django web server by using python manage.py serve <arguments>.

It can run Django management commands with the --command flag, that will be executed asynchronously. The application server will only be started upon successful execution of management commands. During execution of management commands the startup probe responds with a status 400.

Arguments:
  • --static - serve collected static files

  • --media - serve media files

  • --autoreload - reload code on change

  • --debug - set Tornado’s Debug flag

  • --port - the port for Tornado to listen on

  • --startup-probe - the exposed path (default is /startup) for probes to check startup

  • --readiness-probe - the exposed path (default is /ready) for probes to check readiness

  • --liveness-probe - the exposed path (default is /alive) for probes to check liveness

  • --probe-port - the port for Tornado probe route to listen on

  • --req-queue-len - threshold of length of queue of request, which is considered for readiness probe

  • --no-probe - disable probe endpoint

  • --no-metrics - disable metrics collection

  • --command - repetitive command for adding execution of management commands before serving

  • --check-migrations - check if all migrations were applied before starting application

  • --webhook-url- If specified, webhooks will be sent to this url

  • --max-lifetime- If specified, maximum requests after which pod is restarted

add_arguments(parser)[source]

Defines arguments, that can be accepted with serve command.

handle(*args, **options)[source]

Defines functionalities for different arguments. After all arguments were processed, it starts the async event loop.

hurricane.management.commands.consume

class hurricane.management.commands.consume.Command(stdout=None, stderr=None, no_color=False, force_color=False)[source]

Starting a Tornado-powered Django AMQP 0-9-1 consumer. Implements consume command as a management command for django application. The new command can be called using python manage.py consume <arguments>. Arguments:

  • --queue - the AMQP 0-9-1 queue to consume from

  • --exchange - the AMQP 0-9-1 exchange to declare

  • --amqp-port - the message broker connection port

  • --amqp-host - the host address of the message broker

  • --amqp-vhost - the virtual host of the message broker to use with this consumer

  • --handler - the Hurricane AMQP handler class (dotted path)

  • --startup-probe - the exposed path (default is /startup) for probes to check startup

  • --readiness-probe - the exposed path (default is /ready) for probes to check readiness

  • --liveness-probe - the exposed path (default is /alive) for probes to check liveness

  • --probe-port - the port for Tornado probe route to listen on

  • --req-queue-len - threshold of length of queue of request, which is considered for readiness probe

  • --no-probe - disable probe endpoint

  • --no-metrics - disable metrics collection

  • --autoreload - reload code on change

  • --debug - set Tornado’s Debug flag

  • --reconnect - try to reconnect this client automatically as the broker is available again

  • --max-lifetime- If specified, maximum requests after which pod is restarted

add_arguments(parser)[source]

Defines arguments, that can be accepted with consume command.

handle(*args, **options)[source]

Defines functionalities for different arguments. After all arguments were processed, it starts the async event loop.