RPC worker support for pecan server

This patch adds support for launching the RPC worker processes
when using the simple wsgi server for pecan.

Change-Id: I7274083c32fd57133f8b33241c5fa95a8bb9bbb3
Partially-Implements: wsgi-pecan-switch
This commit is contained in:
Kevin Benton 2016-01-22 15:33:10 -08:00
parent d21d9798fe
commit 3d84277897
1 changed files with 4 additions and 1 deletions

View File

@ -21,6 +21,7 @@ from six.moves import socketserver
from neutron._i18n import _LI, _LW
from neutron.common import rpc as n_rpc
from neutron.pecan_wsgi import app as pecan_app
from neutron import service
LOG = log.getLogger(__name__)
@ -32,9 +33,11 @@ class ThreadedSimpleServer(socketserver.ThreadingMixIn,
def pecan_wsgi_server():
LOG.info(_LI("Pecan WSGI server starting..."))
application = pecan_app.setup_app()
# this launches RPC workers in separate processes
service.serve_rpc()
# No AMQP connection should be created within this process
n_rpc.RPC_DISABLED = True
application = pecan_app.setup_app()
host = cfg.CONF.bind_host
port = cfg.CONF.bind_port