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


Python select.KQ_EV_DELETE屬性代碼示例

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


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

示例1: unregister

# 需要導入模塊: import select [as 別名]
# 或者: from select import KQ_EV_DELETE [as 別名]
def unregister(self, fileobj):
            key = super(KqueueSelector, self).unregister(fileobj)
            if key.events & EVENT_READ:
                kevent = select.kevent(key.fd,
                                       select.KQ_FILTER_READ,
                                       select.KQ_EV_DELETE)
                try:
                    _syscall_wrapper(self._kqueue.control, False, [kevent], 0, 0)
                except SelectorError:
                    pass
            if key.events & EVENT_WRITE:
                kevent = select.kevent(key.fd,
                                       select.KQ_FILTER_WRITE,
                                       select.KQ_EV_DELETE)
                try:
                    _syscall_wrapper(self._kqueue.control, False, [kevent], 0, 0)
                except SelectorError:
                    pass

            return key 
開發者ID:snowflakedb,項目名稱:snowflake-connector-python,代碼行數:22,代碼來源:ssl_wrap_util.py

示例2: unregister

# 需要導入模塊: import select [as 別名]
# 或者: from select import KQ_EV_DELETE [as 別名]
def unregister(self, fileobj):
            key = super(KqueueSelector, self).unregister(fileobj)
            if key.events & EVENT_READ:
                kev = select.kevent(key.fd, select.KQ_FILTER_READ,
                                    select.KQ_EV_DELETE)
                try:
                    self._kqueue.control([kev], 0, 0)
                except OSError:
                    # This can happen if the FD was closed since it
                    # was registered.
                    pass
            if key.events & EVENT_WRITE:
                kev = select.kevent(key.fd, select.KQ_FILTER_WRITE,
                                    select.KQ_EV_DELETE)
                try:
                    self._kqueue.control([kev], 0, 0)
                except OSError:
                    # See comment above.
                    pass
            return key 
開發者ID:jpush,項目名稱:jbox,代碼行數:22,代碼來源:selectors.py

示例3: removeReader

# 需要導入模塊: import select [as 別名]
# 或者: from select import KQ_EV_DELETE [as 別名]
def removeReader(self, reader):
        """
        Implement L{IReactorFDSet.removeReader}.
        """
        wasLost = False
        try:
            fd = reader.fileno()
        except:
            fd = -1
        if fd == -1:
            for fd, fdes in self._selectables.items():
                if reader is fdes:
                    wasLost = True
                    break
            else:
                return
        if fd in self._reads:
            self._reads.remove(fd)
            if fd not in self._writes:
                del self._selectables[fd]
            if not wasLost:
                try:
                    self._updateRegistration(fd, KQ_FILTER_READ, KQ_EV_DELETE)
                except OSError:
                    pass 
開發者ID:proxysh,項目名稱:Safejumper-for-Desktop,代碼行數:27,代碼來源:kqreactor.py

示例4: removeWriter

# 需要導入模塊: import select [as 別名]
# 或者: from select import KQ_EV_DELETE [as 別名]
def removeWriter(self, writer):
        """
        Implement L{IReactorFDSet.removeWriter}.
        """
        wasLost = False
        try:
            fd = writer.fileno()
        except:
            fd = -1
        if fd == -1:
            for fd, fdes in self._selectables.items():
                if writer is fdes:
                    wasLost = True
                    break
            else:
                return
        if fd in self._writes:
            self._writes.remove(fd)
            if fd not in self._reads:
                del self._selectables[fd]
            if not wasLost:
                try:
                    self._updateRegistration(fd, KQ_FILTER_WRITE, KQ_EV_DELETE)
                except OSError:
                    pass 
開發者ID:proxysh,項目名稱:Safejumper-for-Desktop,代碼行數:27,代碼來源:kqreactor.py

示例5: unregister

# 需要導入模塊: import select [as 別名]
# 或者: from select import KQ_EV_DELETE [as 別名]
def unregister(self, fileobj):
            key = super().unregister(fileobj)
            if key.events & EVENT_READ:
                kev = select.kevent(key.fd, select.KQ_FILTER_READ,
                                    select.KQ_EV_DELETE)
                try:
                    self._kqueue.control([kev], 0, 0)
                except OSError:
                    # This can happen if the FD was closed since it
                    # was registered.
                    pass
            if key.events & EVENT_WRITE:
                kev = select.kevent(key.fd, select.KQ_FILTER_WRITE,
                                    select.KQ_EV_DELETE)
                try:
                    self._kqueue.control([kev], 0, 0)
                except OSError:
                    # See comment above.
                    pass
            return key 
開發者ID:Microvellum,項目名稱:Fluid-Designer,代碼行數:22,代碼來源:selectors.py

示例6: unregister

# 需要導入模塊: import select [as 別名]
# 或者: from select import KQ_EV_DELETE [as 別名]
def unregister(self, fileobj):
            key = super().unregister(fileobj)
            if key.events & EVENT_READ:
                kev = select.kevent(key.fd, select.KQ_FILTER_READ,
                                    select.KQ_EV_DELETE)
                try:
                    self._selector.control([kev], 0, 0)
                except OSError:
                    # This can happen if the FD was closed since it
                    # was registered.
                    pass
            if key.events & EVENT_WRITE:
                kev = select.kevent(key.fd, select.KQ_FILTER_WRITE,
                                    select.KQ_EV_DELETE)
                try:
                    self._selector.control([kev], 0, 0)
                except OSError:
                    # See comment above.
                    pass
            return key 
開發者ID:CedricGuillemet,項目名稱:Imogen,代碼行數:22,代碼來源:selectors.py


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