hurricane.server

hurricane.server.django

class hurricane.server.django.DjangoHandler(application: tornado.web.Application, request: tornado.httputil.HTTPServerRequest, **kwargs: Any)[source]

This handler transmits all standard requests to django application. Currently it uses WSGI Container based on tornado WSGI Container.

initialize()[source]

Initialization of Hurricane WSGI Container.

async prepare() → None[source]

Transmitting incoming request to django application via WSGI Container.

class hurricane.server.django.DjangoLivenessHandler(application: tornado.web.Application, request: tornado.httputil.HTTPServerRequest, **kwargs: Any)[source]

This handler runs with every call to the probe endpoint which is supposed to be used

class hurricane.server.django.DjangoProbeHandler(application: tornado.web.Application, request: tornado.httputil.HTTPServerRequest, **kwargs: Any)[source]

Parent class for all specific probe handlers.

compute_etag()[source]

Computes the etag header to be used for this request.

By default uses a hash of the content written so far.

May be overridden to provide custom etag implementations, or may return None to disable tornado’s default etag support.

async get()[source]

Get method, which runs the check.

async post()[source]

Post method, which runs the check.

set_extra_headers(path)[source]

Setting of extra headers for cache-control, namely: no-store, no-cache, must-revalidate and max-age=0. It means that information on requests and responses will not be stored.

class hurricane.server.django.DjangoReadinessHandler(application: tornado.web.Application, request: tornado.httputil.HTTPServerRequest, **kwargs: Any)[source]

This handler runs with every call to the probe endpoint which is supposed to be used with Kubernetes ‘Readiness Probes’. The DjangoCheckHandler calls Django’s Check Framework which can be used to determine the application’s health state during its operation.

class hurricane.server.django.DjangoStartupHandler(application: tornado.web.Application, request: tornado.httputil.HTTPServerRequest, **kwargs: Any)[source]

This handler runs with every call to the probe endpoint which is supposed to be used with Kubernetes ‘Startup Probes’. It returns 400 response for post and get requests, if StartupTimeMetric is not set, what means that the application is still in the startup phase. As soon as StartupTimeMetric is set, this handler returns 200 response upon request, which indicates, that startup phase is finished and Kubernetes can now poll liveness/readiness probes.

hurricane.server.wsgi

class hurricane.server.wsgi.HurricaneWSGIContainer(handler, wsgi_application)[source]

Wrapper for the tornado WSGI Container, which creates a WSGI-compatible function runnable on Tornado’s HTTP server. Additionally to tornado WSGI Container should be initialized with the specific handler.

exception hurricane.server.wsgi.HurricaneWSGIException[source]