guillotina.request

class guillotina.request.Request(*args, **kwargs)

Bases: aiohttp.web_request.Request

Guillotina specific request type. We store potentially a lot of state onto the request object as it is essential our poor man’s thread local model

add_future(name, fut, scope='', args=None, kwargs=None)

Register a future to be executed after the request has finished.

Parameters:
  • name (str) – name of future
  • fut (Callable[…, Coroutine[Any, Any, Any]]) – future to execute after request
  • scope (str) – group the futures to execute different groupings together
  • args – arguments to execute future with
  • kwargs – kwargs to execute future with
execute_futures(scope='')

Execute all the registered futures in a new task

Parameters:scope (str) – scoped futures to execute. Leave default for normal behavior
get_future(name, scope='')

Get a registered future

Parameters:
  • name (str) – scoped futures to execute. Leave default for normal behavior
  • scope (str) – scope name the future was registered for
matchdict = None

Dictionary of matched path parameters on request

record(event_name)

Record event on the request

Parameters:event_name (str) – name of event