|
The interfaces to be started on a cage are listed in
./cages/cage/config/startup.py:
def start()
#pmnc.xmlrpc_interface.start()
#pmnc.soap_interface.start()
pmnc.jms_interface.start()
def stop():
pmnc.jms_interface.stop()
#pmnc.soap_interface.stop()
#pmnc.xmlrpc_interface.stop()
By default all the interfaces on a cage are disabled, all the start/stop line pairs are
commented out. In the above example the JMS interface must have been enabled manually
by uncommenting the corresponding lines. For the changes in interface list to take effect
the cage needs to be restarted.
All the cage's interfaces are configured in the single configuration file
./cages/cage/config/config_interfaces.py. Each of the interfaces referenced from the above mentioned startup.py
has its own private section in that file:
def config_static(config):
############################## HTTP INTERFACE
config.set("http_interface.server.0.host", "0.0.0.0")
config.set("http_interface.server.1.port", 8000)
...
############################## XMLRPC INTERFACE
config.set("xmlrpc_interface.server.0.host", "0.0.0.0")
config.set("xmlrpc_interface.server.1.port", 8000)
...
and should be configured before the cage is started. Different interfaces require
various protocol-specific parameters, the simplest way of knowing is to simply
examine the sample configurations.
But there is one parameter which presents for all interfaces and also one which
presents for all synchronous (web services) interfaces:
config.set("http_interface.request_timeout", 60.0)
config.set("http_interface.worker_threads", 10)
The request_timeout parameter exists for all interfaces, because request processing
in Pythomnic is essentially synchronous and processing of a request arriving through
an interface therefore must complete before
request_timeout seconds.
The worker_theads for the synchronous web services interfaces sets the size of the
worker thread pool. No more than worker_threads will be executing at a time, and the
rest will be queued up waiting for a free worker thread. This strategy is also described
under stress resilience.
|
Features Download Documentation Tutorial |