本文整理汇总了Python中multiprocessing.process.Process.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Process.__init__方法的具体用法?Python Process.__init__怎么用?Python Process.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类multiprocessing.process.Process
的用法示例。
在下文中一共展示了Process.__init__方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from multiprocessing.process import Process [as 别名]
# 或者: from multiprocessing.process.Process import __init__ [as 别名]
def __init__(self, fd, queue):
assert hasattr(queue, 'put')
assert hasattr(queue, 'empty')
assert callable(fd.readline)
Process.__init__(self)
self._fd = fd
self._queue = queue
示例2: __init__
# 需要导入模块: from multiprocessing.process import Process [as 别名]
# 或者: from multiprocessing.process.Process import __init__ [as 别名]
def __init__(self, pipe, object_class, *args, **kwargs):
Process.__init__(self)
self.object_class = object_class
self.init_args = args
self.init_kwargs = kwargs
self.pipe = pipe
self.command_queue = []
self.message_priorities = {}
示例3: __init__
# 需要导入模块: from multiprocessing.process import Process [as 别名]
# 或者: from multiprocessing.process.Process import __init__ [as 别名]
def __init__(self, sem, port=2022, protocol=ProtocolEnumerator.ECHO, users={}):
Process.__init__(self, name = "SSHServer")
self.port = port
self.users = users
self.privateKeys = {}
self.publicKeys = {}
self.protocol_ = protocol
self.exitCmd = "exit"
self.messages = []
self.sem = sem
示例4: __init__
# 需要导入模块: from multiprocessing.process import Process [as 别名]
# 或者: from multiprocessing.process.Process import __init__ [as 别名]
def __init__(self, **kwargs):
"""
@param init_target: unbound instance method to call at process start
@param wrap_target: unbound instance method to wrap worker function
@param term_target: unbound instance method to call at process finish
"""
self._init_target = kwargs.pop("init_target", lambda self: None).__get__(self, Process)
self._wrap_target = kwargs.pop("wrap_target", lambda self: None).__get__(self, Process)
self._term_target = kwargs.pop("term_target", lambda self: None).__get__(self, Process)
Process.__init__(self, **kwargs)
示例5: __init__
# 需要导入模块: from multiprocessing.process import Process [as 别名]
# 或者: from multiprocessing.process.Process import __init__ [as 别名]
def __init__(self, event_loop = ThreadedEventLoop()):
Process.__init__(self)
self.server_pipe, self.client_pipe = Pipe()
self.server_router = Router(self.server_pipe)
self.client_router = Router(self.client_pipe)
self.srv_command_pipe = self.server_router.create()
self.cli_command_pipe = self.client_router.create(self.srv_command_pipe.id)
self.children = {}
self.client_event_loop = event_loop
self.client_event_loop.register_hook(self.client_router.eventloop_hook)
示例6: __init__
# 需要导入模块: from multiprocessing.process import Process [as 别名]
# 或者: from multiprocessing.process.Process import __init__ [as 别名]
def __init__(self, username, password, host, cmdsToSend, port = 22, exitCmd = "exit", timeout = None):
Process.__init__(self, name = "SSHClient")
self.logger = LogManager().getLogger('SSHClient-%s' % host)
self.username = username
self.password = password
self.host = host
self.port = int(port)
self.cmdsToSend = cmdsToSend if isinstance(cmdsToSend, list) else [cmdsToSend]
self.exitCmd = exitCmd
self.queue = Queue()
self.msg = ""
self.status = Status.FAILURE
self.startTime = Value('d', 0.0)
self.endTime = Value('d', 0.0)
self.timeout = timeout or SSHClient.TIMEOUT
self.cmdsSend = False
self.start()
示例7: __init__
# 需要导入模块: from multiprocessing.process import Process [as 别名]
# 或者: from multiprocessing.process.Process import __init__ [as 别名]
def __init__(self, queue):
Process.__init__(self, name = "UDPServer")
#self.daemon = True
self.queue = queue
self.shutdownQueue = Queue()
self.start()
示例8: __init__
# 需要导入模块: from multiprocessing.process import Process [as 别名]
# 或者: from multiprocessing.process.Process import __init__ [as 别名]
def __init__(self, group=None, target=None, name=None, args=(), kwargs={}):
Process.__init__(self, group=group, target=target, name=name, args=args, kwargs=kwargs)
示例9: __init__
# 需要导入模块: from multiprocessing.process import Process [as 别名]
# 或者: from multiprocessing.process.Process import __init__ [as 别名]
def __init__(self, sa):
Process.__init__(self)
self.sa = sa
self.arr = sa.getNumpyWrapper()