當前位置: 首頁>>代碼示例>>Python>>正文


Python asyncore.file_dispatcher方法代碼示例

本文整理匯總了Python中asyncore.file_dispatcher方法的典型用法代碼示例。如果您正苦於以下問題:Python asyncore.file_dispatcher方法的具體用法?Python asyncore.file_dispatcher怎麽用?Python asyncore.file_dispatcher使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在asyncore的用法示例。


在下文中一共展示了asyncore.file_dispatcher方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

# 需要導入模塊: import asyncore [as 別名]
# 或者: from asyncore import file_dispatcher [as 別名]
def __init__(self, map):
            _triggerbase.__init__(self)
            r, self.trigger = self._fds = os.pipe()
            asyncore.file_dispatcher.__init__(self, r, map=map) 
開發者ID:MayOneUS,項目名稱:pledgeservice,代碼行數:6,代碼來源:trigger.py

示例2: test_dispatcher

# 需要導入模塊: import asyncore [as 別名]
# 或者: from asyncore import file_dispatcher [as 別名]
def test_dispatcher(self):
        fd = os.open(TESTFN, os.O_RDONLY)
        data = []
        class FileDispatcher(asyncore.file_dispatcher):
            def handle_read(self):
                data.append(self.recv(29))
        s = FileDispatcher(fd)
        os.close(fd)
        asyncore.loop(timeout=0.01, use_poll=True, count=2)
        self.assertEqual(b"".join(data), self.d) 
開發者ID:IronLanguages,項目名稱:ironpython2,代碼行數:12,代碼來源:test_asyncore.py

示例3: __init__

# 需要導入模塊: import asyncore [as 別名]
# 或者: from asyncore import file_dispatcher [as 別名]
def __init__(self, watch_manager, default_proc_fun=None, read_freq=0,
                 threshold=0, timeout=None, channel_map=None):
        """
        Initializes the async notifier. The only additional parameter is
        'channel_map' which is the optional asyncore private map. See
        Notifier class for the meaning of the others parameters.

        """
        Notifier.__init__(self, watch_manager, default_proc_fun, read_freq,
                          threshold, timeout)
        asyncore.file_dispatcher.__init__(self, self._fd, channel_map) 
開發者ID:restran,項目名稱:hacker-scripts,代碼行數:13,代碼來源:pyinotify.py

示例4: test_dispatcher

# 需要導入模塊: import asyncore [as 別名]
# 或者: from asyncore import file_dispatcher [as 別名]
def test_dispatcher(self):
        fd = os.open(support.TESTFN, os.O_RDONLY)
        data = []
        class FileDispatcher(asyncore.file_dispatcher):
            def handle_read(self):
                data.append(self.recv(29))
        s = FileDispatcher(fd)
        os.close(fd)
        asyncore.loop(timeout=0.01, use_poll=True, count=2)
        self.assertEqual(b"".join(data), self.d) 
開發者ID:Microvellum,項目名稱:Fluid-Designer,代碼行數:12,代碼來源:test_asyncore.py

示例5: __init__

# 需要導入模塊: import asyncore [as 別名]
# 或者: from asyncore import file_dispatcher [as 別名]
def __init__(self, cid=None):
        if _debug: ConsoleClient._debug("__init__ cid=%r", cid)
        asyncore.file_dispatcher.__init__(self, sys.stdin)
        Client.__init__(self, cid) 
開發者ID:JoelBender,項目名稱:bacpypes,代碼行數:6,代碼來源:console.py

示例6: __init__

# 需要導入模塊: import asyncore [as 別名]
# 或者: from asyncore import file_dispatcher [as 別名]
def __init__(self):
        if _debug: WaitableEvent._debug("__init__")

        # make a pipe
        self._read_fd, self._write_fd = os.pipe()

        # continue with init
        asyncore.file_dispatcher.__init__(self, self._read_fd) 
開發者ID:JoelBender,項目名稱:bacpypes,代碼行數:10,代碼來源:event.py

示例7: __init__

# 需要導入模塊: import asyncore [as 別名]
# 或者: from asyncore import file_dispatcher [as 別名]
def __init__(self, fd: int) -> None:
        asyncore.file_dispatcher.__init__(self, fd)
        self.fd = fd
        self.read_buffer = b''
        self.write_buffer = b'' 
開發者ID:innogames,項目名稱:polysh,代碼行數:7,代碼來源:buffered_dispatcher.py


注:本文中的asyncore.file_dispatcher方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。