namespace python_json_engine¶
Overview¶
namespace python_json_engine { // classes class StandaloneApplication; // global variables int DEFAULT_TIMEOUT = 90; int DEFAULT_WORKERS = 1; log = logging.getLogger("werkzeug"); app = Flask(__name__); Namespace args = parse_arguments(); hostname; port; dict options = prepare_options(args.options, hostname, port); // global functions def all_exception_handler(error error); def initialize(); def run_loop(); def set_datapack(); def get_datapack(); def reset(); def shutdown(); Namespace parse_arguments(); bool is_port_in_use(str address, int port); int find_free_port(); tuple extract_hostname_port_from_url(str url); None register_in_regserver( str regserver_url, str engine_name, str hostname, int port ); dict parse_extra_options(str options_str); dict prepare_options(str extra_options, str hostname, int port); } // namespace python_json_engine
Detailed Documentation¶
Global Functions¶
def all_exception_handler(error error)
Custom error handler for error code 500. The default handler returns a html response,
which doesn't look very nice when printed to terminal.
bool is_port_in_use(str address, int port)
Checks if given port is already in use
int find_free_port()
Returns a random free port number
None register_in_regserver( str regserver_url, str engine_name, str hostname, int port )
Registers in the registration server of the client
dict parse_extra_options(str options_str)
Parses the extra server options passed by the user
Expected format is a python dict: '{ "option1": value1, "option2": value2 }'
dict prepare_options(str extra_options, str hostname, int port)
Prepares the dictionary with options for the server application