Package coilmq :: Module start
[frames] | no frames]

Module start

Entrypoint for starting the application.


Author: "Hans Lellelid" <hans@xmpl.org>

Copyright: Copyright 2009 Hans Lellelid

License: Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Functions
coilmq.server.StompServer
server_from_config(config=None, server_class=None, additional_kwargs=None)
Gets a configured coilmq.server.StompServer from specified config.
 
context_serve(options, context)
Takes a context object, which implements the __enter__/__exit__ "with" interface and starts a server within that context.
 
main()
Main entry point for running a socket server from the commandline.
Variables
  daemon_support = False
  logger = lambda:
Function Details

server_from_config(config=None, server_class=None, additional_kwargs=None)

 

Gets a configured coilmq.server.StompServer from specified config.

If `config` is None, global coilmq.config.config var will be used instead.

The `server_class` and `additional_kwargs` are primarily hooks for using this method from a testing environment.

Parameters:
  • config (ConfigParser.ConfigParser) - A ConfigParser.ConfigParser instance with loaded config values.
  • server_class (class) - Which class to use for the server. (This doesn't come from config currently.)
  • additional_kwargs (list) - Any additional args that should be passed to class.
Returns: coilmq.server.StompServer
The configured StompServer.

context_serve(options, context)

 

Takes a context object, which implements the __enter__/__exit__ "with" interface and starts a server within that context.

This method is a refactored single-place for handling the server-run code whether running in daemon or non-daemon mode. It is invoked with a dummy (passthrough) context object for the non-daemon use case.

Parameters:
  • options (ConfigParser) - The compiled collection of options that need to be parsed.
  • context (object) - The context object that implements __enter__/__exit__ "with" methods.
Raises:
  • Exception - Any underlying exception will be logged but then re-raised.

See Also: server_from_config()

main()

 

Main entry point for running a socket server from the commandline.

This method will read in options from the commandline and call the config.init_config method to get everything setup. Then, depending on whether deamon mode was specified or not, the process may be forked (or not) and the server will be started.