hbp_nrp_backend.rest_server.RestSyncMiddleware module

This module makes some rest requests multi-threadable. By default, all rest requests are considered not thread safe and are therefore synchronized. Requests that are known to be thread-safe, are executed concurrently. To mark a rest request as thread-safe, decorate the Resource function handling the request (get, post, delete, put) with the decorator @RestSyncMiddleware.threadsafe

class hbp_nrp_backend.rest_server.RestSyncMiddleware.RestSyncMiddleware(wsgi_app, app)[source]

Bases: object

Middleware that allows thread-safe requests to be executed concurrently

thread_safe_contextmanager(view_fn)[source]
static threadsafe(func)[source]

Decorates functions as thread-safe