本文整理汇总了Python中multiprocessing.managers.SyncManager.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python SyncManager.__init__方法的具体用法?Python SyncManager.__init__怎么用?Python SyncManager.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类multiprocessing.managers.SyncManager
的用法示例。
在下文中一共展示了SyncManager.__init__方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from multiprocessing.managers import SyncManager [as 别名]
# 或者: from multiprocessing.managers.SyncManager import __init__ [as 别名]
def __init__(self, queue_size=None):
#print "instantiating process manager"
SyncManager.__init__(self)
self.start()
self.ff = None
self.input_queue = self.Queue(queue_size)
self.output_queue = self.Queue(queue_size)
self.worker = None
示例2: __int__
# 需要导入模块: from multiprocessing.managers import SyncManager [as 别名]
# 或者: from multiprocessing.managers.SyncManager import __init__ [as 别名]
def __int__(self, name='default', address=None, authkey=None):
"""
This is the default constructor for the class.
:param name: The manager name
:param address: The address of the server
:param authkey: The auth key
:return:
"""
# Set internals
self.__name = name
# Override the manager
SyncManager.__init__(address, authkey)
return
示例3: __int__
# 需要导入模块: from multiprocessing.managers import SyncManager [as 别名]
# 或者: from multiprocessing.managers.SyncManager import __init__ [as 别名]
def __int__(self, address=MANAGER_ADDRESS, authkey=MANAGER_PASSWORD):
"""
This is the default constructor for the
class that registers the valid methods that
can be called in the manager context.
:param address: The address as a tuple (address, port)
:param auth: The authentication for the server
:return:
"""
self.register("get_MqttRxBuffer")
self.register("get_MqttTxBuffer")
self.register("get_RawRxBuffer")
self.register("get_RawTxBuffer")
# Override the base class
SyncManager.__init__(address, authkey)
return
示例4: __init__
# 需要导入模块: from multiprocessing.managers import SyncManager [as 别名]
# 或者: from multiprocessing.managers.SyncManager import __init__ [as 别名]
def __init__(self, address=MANAGER_ADDRESS, pwd=MANAGER_PASSWORD):
"""
This is the constructor for the class object that takes
both the managers address and password.
:param address: The address of the manager server
:param pwd: The managers password access
:return:
"""
# Override the base class
SyncManager.__init__(address, pwd)
Singleton.__init__(self)
# Register the classes needed
self.register("get_MqttRxBuffer", callable=lambda: self.__MqttRxBuffer)
self.register("get_MqttTxBuffer", callable=lambda: self.__MqttTxBuffer)
self.register("get_RawRxBuffer", callable=lambda: self.__RawTxBuffer)
self.register("get_RawTxBuffer", callable=lambda: self.__RawRxBuffer)
return
示例5: __init__
# 需要导入模块: from multiprocessing.managers import SyncManager [as 别名]
# 或者: from multiprocessing.managers.SyncManager import __init__ [as 别名]
def __init__(self, name="TaskList", mix_ins=None,
prefix='ask_', *args, **kwds):
SyncManager.__init__(self)
self._name = name
self._mix_ins = mix_ins
self._prefix = prefix
self._args = args
self._kwds = kwds
x = []
if mix_ins:
for m in mix_ins:
for attr in dir(m):
if attr.startswith(prefix):
x.append(attr)
self.register(
'TaskList',
callable=TaskList,
exposed=(x))
示例6: __init__
# 需要导入模块: from multiprocessing.managers import SyncManager [as 别名]
# 或者: from multiprocessing.managers.SyncManager import __init__ [as 别名]
def __init__(self, host, port):
SyncManager.__init__(self, address=(host, port), authkey='rWorker')
Manager.has_instance = True
示例7: __init__
# 需要导入模块: from multiprocessing.managers import SyncManager [as 别名]
# 或者: from multiprocessing.managers.SyncManager import __init__ [as 别名]
def __init__(self):
SyncManager.__init__(self)
self.register( 'DiskSpaceProctor',
callable=DiskSpaceProctor,
exposed=('_can_write', '_close_write', 'make_dirs'))