This commit is contained in:
Tobias Oberstein
2017-02-22 20:51:09 +01:00
parent da72cb1380
commit 06bac7b0b1

View File

@@ -110,7 +110,7 @@ class ApplicationRunner(object):
self.serializers = serializers
self.ssl = ssl
def run(self, make):
def run(self, make, start_loop=True):
"""
Run the application component.
@@ -118,7 +118,7 @@ class ApplicationRunner(object):
when called with an instance of :class:`autobahn.wamp.types.ComponentConfig`.
:type make: callable
"""
# 1) factory for use ApplicationSession
if callable(make):
def create():
cfg = ComponentConfig(self.realm, self.extra)
try:
@@ -131,6 +131,8 @@ class ApplicationRunner(object):
raise
else:
return session
else:
create = make
isSecure, host, port, resource, path, params = parse_url(self.url)
@@ -154,6 +156,12 @@ class ApplicationRunner(object):
coro = loop.create_connection(transport_factory, host, port, ssl=ssl)
(transport, protocol) = loop.run_until_complete(coro)
if not start_loop:
return protocol
else:
# start logging
txaio.start_logging(level='info')