wip
This commit is contained in:
@@ -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')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user