progrium/gservice — Issue #23: change RootService to Context, add configuration
Author: progrium
Created: 2011-12-03 03:24:46+00:00
State: open

Context should be the top level gservice object that a Runner will create to start an application. It should be responsible for parsing a configuration file if provided, or taking/overriding with a configuration dictionary (although the code should live in the config module). This means it should also run the service factory in the configuration.

It should also own the named global services. The _main_services in Service should live in Context. Services should have a reference to the Context (all services live within a context).

ultimately, you should be able to instantiate a gservice application by creating a Context instance. For example:

app1 = Context(file='/path/to/app1.conf.py')
app2 = Context(file='/path/to/app2.conf.py')

Allowing you to write functional tests of interacting applications in the same process.