本文整理汇总了Python中spyne.server.ServerBase.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python ServerBase.__init__方法的具体用法?Python ServerBase.__init__怎么用?Python ServerBase.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类spyne.server.ServerBase
的用法示例。
在下文中一共展示了ServerBase.__init__方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from spyne.server import ServerBase [as 别名]
# 或者: from spyne.server.ServerBase import __init__ [as 别名]
def __init__(self, app, chunked=False,
max_content_length=2 * 1024 * 1024,
block_length=8 * 1024):
ServerBase.__init__(self, app)
self.chunked = chunked
self.max_content_length = max_content_length
self.block_length = block_length
示例2: __init__
# 需要导入模块: from spyne.server import ServerBase [as 别名]
# 或者: from spyne.server.ServerBase import __init__ [as 别名]
def __init__(self, app, app_url, wsdl_url=None):
ServerBase.__init__(self, app)
self.app_url = app_url
self.wsdl_url = wsdl_url
self.zmq_socket = context.socket(zmq.REP)
self.zmq_socket.bind(app_url)
示例3: __init__
# 需要导入模块: from spyne.server import ServerBase [as 别名]
# 或者: from spyne.server.ServerBase import __init__ [as 别名]
def __init__(self, db, app, consumer_id):
ServerBase.__init__(self, app)
self.session = sessionmaker(bind=db)()
self.id = consumer_id
if self.session.query(WorkerStatus).get(self.id) is None:
self.session.add(WorkerStatus(worker_id=self.id))
self.session.commit()
示例4: __init__
# 需要导入模块: from spyne.server import ServerBase [as 别名]
# 或者: from spyne.server.ServerBase import __init__ [as 别名]
def __init__(self, app, chunked=False,
max_content_length=2 * 1024 * 1024,
block_length=8 * 1024):
ServerBase.__init__(self, app)
self._allowed_http_verbs = app.in_protocol.allowed_http_verbs
self.chunked = chunked
self.max_content_length = max_content_length
self.block_length = block_length
示例5: __init__
# 需要导入模块: from spyne.server import ServerBase [as 别名]
# 或者: from spyne.server.ServerBase import __init__ [as 别名]
def __init__(self, db, app, consumer_id):
ServerBase.__init__(self, app)
self.session = sessionmaker(bind=db)()
self.id = consumer_id
worker_status = self.session.query(WorkerStatus).filter_by(worker_id=self.id).first()
if worker_status is None:
self.session.add(WorkerStatus(worker_id=self.id, task_id=0))
self.session.commit()
示例6: __init__
# 需要导入模块: from spyne.server import ServerBase [as 别名]
# 或者: from spyne.server.ServerBase import __init__ [as 别名]
def __init__(self, db, app, consumer_id):
ServerBase.__init__(self, app)
self.session = sessionmaker(bind=db)()
self.id = consumer_id
try:
self.session.query(WorkerStatus) \
.filter_by(worker_id=self.id).one()
except NoResultFound:
self.session.add(WorkerStatus(worker_id=self.id, task_id=0))
self.session.commit()
示例7: __init__
# 需要导入模块: from spyne.server import ServerBase [as 别名]
# 或者: from spyne.server.ServerBase import __init__ [as 别名]
def __init__(self, app):
ServerBase.__init__(self, app)
self.service = _FunctionProxy(self, self.app)
self.factory = Factory(self.app)