当前位置: 首页>>代码示例>>Python>>正文


Python Listener.__init__方法代码示例

本文整理汇总了Python中multiprocessing.connection.Listener.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Listener.__init__方法的具体用法?Python Listener.__init__怎么用?Python Listener.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在multiprocessing.connection.Listener的用法示例。


在下文中一共展示了Listener.__init__方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from multiprocessing.connection import Listener [as 别名]
# 或者: from multiprocessing.connection.Listener import __init__ [as 别名]
 def __init__ (self):   
     from app import APP
     self.logger = APP.LoggingClient(name="UIHUB")
     addr = APP.Functions.parse_socket_address ( APP.BE.CLI.server_address )
     try: os.unlink (addr)
     except: pass
     self.logger( "Starting. Listening on {0}".format (addr) )
     Listener.__init__(self, addr)
     self.queue = ThreadingQueue.Queue(1024)
     self.workers = [CLIWorker(self.queue, self.logger) for i in range(0,5)]
开发者ID:amamitzsch,项目名称:docsis-provisioning,代码行数:12,代码来源:cli.py

示例2: __init__

# 需要导入模块: from multiprocessing.connection import Listener [as 别名]
# 或者: from multiprocessing.connection.Listener import __init__ [as 别名]
 def __init__(self, *args, **kwargs):
     Listener.__init__(self, *args, **kwargs)
     # multiprocessing tries to call unlink even on abstract
     # named sockets, prevent it from doing so.
     self._listener._unlink.cancel()
     # Prevent child processes from inheriting this socket
     # If we dont do this child processes not created by calibre, will
     # inherit this socket, preventing the calibre GUI from being restarted.
     # Examples of such processes are external viewers launched by Qt
     # using openUrl().
     fd = self._listener._socket.fileno()
     old_flags = fcntl.fcntl(fd, fcntl.F_GETFD)
     fcntl.fcntl(fd, fcntl.F_SETFD, old_flags | fcntl.FD_CLOEXEC)
开发者ID:AtulKumar2,项目名称:calibre,代码行数:15,代码来源:server.py

示例3: __init__

# 需要导入模块: from multiprocessing.connection import Listener [as 别名]
# 或者: from multiprocessing.connection.Listener import __init__ [as 别名]
 def __init__(self, *args, **kwargs):
     Listener.__init__(self, *args, **kwargs)
     # multiprocessing tries to call unlink even on abstract
     # named sockets, prevent it from doing so.
     self._listener._unlink.cancel()
开发者ID:JackonYang,项目名称:calibre,代码行数:7,代码来源:server.py

示例4: __init__

# 需要导入模块: from multiprocessing.connection import Listener [as 别名]
# 或者: from multiprocessing.connection.Listener import __init__ [as 别名]
 def __init__(self):
     Listener.__init__(self, 'AF_PIPE')
     self.establish_connection_to_close_lock = thread.allocate_lock()
开发者ID:isabelmette,项目名称:pynet,代码行数:5,代码来源:Listener.py


注:本文中的multiprocessing.connection.Listener.__init__方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。