quorum

quorum.load(app=None, name=None, secret_key=None, execution=True, redis_session=False, mongo_database=None, logger=None, models=None, **kwargs)

Initial loader function responsible for the overriding of the flask loading system and for the loading of configuration.

Note

This function should be called inside you main app file failure to do so may result in unexpected behavior.

Parameters:
  • app (Application) – The optional flask application object to be used in the loading of quorum (useful for self managed apps).
  • name (String) – The name to be used to describe the application for the management of internal values.
  • secret_key (String) – The secret seed value to be used for cryptographic operations under flask (eg: client side sessions) this value should be shared among all the pre-fork instances.
  • execution (bool) – Flag indicating if the (background) execution thread should be started providing the required support for background tasks.
  • redis_session (bool) – If the session management for the flask infra-structure should be managed using a server side session with support from redis.
  • mongo_database (String) – The default name of the database to be used when using the mongo infra-structure.
  • logger (String) – The name to be used as identification for possible logger files created by the logging sub-module.
  • models (Module) – The module containing the complete set of model classes to be used by the data infra-structure (eg: mongo).
Return type:

Application

Returns:

The application that is used by the loaded quorum environment in case one was provided that is retrieved, otherwise the newly created one is returned instead.

quorum.unload()

Unloads the current quorum instance, after this call no more access to the quorum facilities is allowed.

Warning

Use this function with care as it may result in unexpected behavior from a developer point of view.

Note

After the call to this method most of the functionally of quorum will become unavailable until further call to quorum.load().

enumerate(sequence[, start=0])

Return an iterator that yields tuples of an index and an item of the sequence. (And so on.)

Related Topics

This Page

Fork me on GitHub