本文整理汇总了Python中crossbar.common.process.NativeProcessSession.onConnect方法的典型用法代码示例。如果您正苦于以下问题:Python NativeProcessSession.onConnect方法的具体用法?Python NativeProcessSession.onConnect怎么用?Python NativeProcessSession.onConnect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类crossbar.common.process.NativeProcessSession
的用法示例。
在下文中一共展示了NativeProcessSession.onConnect方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: onConnect
# 需要导入模块: from crossbar.common.process import NativeProcessSession [as 别名]
# 或者: from crossbar.common.process.NativeProcessSession import onConnect [as 别名]
def onConnect(self):
"""
Called when the worker has connected to the node's management router.
"""
self._node_id = self.config.extra.node
self._worker_id = self.config.extra.worker
self._uri_prefix = u'crossbar.worker.{}'.format(self._worker_id)
NativeProcessSession.onConnect(self, False)
self._module_tracker = TrackingModuleReloader(snapshot=False)
self._profiles = {}
# flag indicating when worker is shutting down
self._is_shutting_down = False
# Jinja2 templates for Web (like WS status page et al)
#
templates_dir = os.path.abspath(pkg_resources.resource_filename("crossbar", "web/templates"))
self.log.debug("Using Web templates from {templates_dir}",
templates_dir=templates_dir)
self._templates = jinja2.Environment(loader=jinja2.FileSystemLoader(templates_dir))
self.join(self.config.realm)
示例2: onConnect
# 需要导入模块: from crossbar.common.process import NativeProcessSession [as 别名]
# 或者: from crossbar.common.process.NativeProcessSession import onConnect [as 别名]
def onConnect(self):
# self._uri_prefix = 'crossbar.node.{}'.format(self.config.extra.node)
self._uri_prefix = 'crossbar.node.{}'.format(self._node_id)
NativeProcessSession.onConnect(self, False)
# self.join(self.config.realm)
self.join(self._realm)
示例3: onConnect
# 需要导入模块: from crossbar.common.process import NativeProcessSession [as 别名]
# 或者: from crossbar.common.process.NativeProcessSession import onConnect [as 别名]
def onConnect(self):
self.log.debug("Connected to node management router")
NativeProcessSession.onConnect(self, False)
# self.join(self.config.realm)
self.join(self._realm)
示例4: onConnect
# 需要导入模块: from crossbar.common.process import NativeProcessSession [as 别名]
# 或者: from crossbar.common.process.NativeProcessSession import onConnect [as 别名]
def onConnect(self):
self.log.debug("Connected to node management router")
# self._uri_prefix = u'crossbar.node.{}'.format(self.config.extra.node)
self._uri_prefix = u'crossbar.node.{}'.format(self._node_id)
NativeProcessSession.onConnect(self, False)
# self.join(self.config.realm)
self.join(self._realm)
示例5: onConnect
# 需要导入模块: from crossbar.common.process import NativeProcessSession [as 别名]
# 或者: from crossbar.common.process.NativeProcessSession import onConnect [as 别名]
def onConnect(self):
"""
Called when the worker has connected to the node's management router.
"""
self._uri_prefix = 'crossbar.node.{}.worker.{}'.format(self.config.extra.node, self.config.extra.worker)
NativeProcessSession.onConnect(self, False)
self._module_tracker = TrackingModuleReloader(debug=True)
self.join(self.config.realm)
示例6: onConnect
# 需要导入模块: from crossbar.common.process import NativeProcessSession [as 别名]
# 或者: from crossbar.common.process.NativeProcessSession import onConnect [as 别名]
def onConnect(self):
"""
Called when the worker has connected to the node's management router.
"""
self._uri_prefix = 'crossbar.node.{}.worker.{}'.format(self.config.extra.node, self.config.extra.worker)
NativeProcessSession.onConnect(self, False)
self._module_tracker = TrackingModuleReloader(debug=True)
self._profiles = {}
# Jinja2 templates for Web (like WS status page et al)
#
templates_dir = os.path.abspath(pkg_resources.resource_filename("crossbar", "web/templates"))
self.log.debug("Using Web templates from {templates_dir}",
templates_dir=templates_dir)
self._templates = jinja2.Environment(loader=jinja2.FileSystemLoader(templates_dir))
self.join(self.config.realm)