~certify-web-dev/twisted/certify-staging

« back to all changes in this revision

Viewing changes to twisted/internet/kqreactor.py

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2010-01-02 19:38:17 UTC
  • mfrom: (2.2.4 sid)
  • Revision ID: james.westby@ubuntu.com-20100102193817-jphp464ppwh7dulg
Tags: 9.0.0-1
* python-twisted: Depend on the python-twisted-* 9.0 packages.
* python-twisted: Depend on python-zope.interface only. Closes: #557781.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (c) 2001-2007 Twisted Matrix Laboratories.
 
1
# Copyright (c) 2001-2009 Twisted Matrix Laboratories.
2
2
# See LICENSE for details.
3
3
 
4
 
 
5
4
"""
6
5
A kqueue()/kevent() based implementation of the Twisted main loop.
7
6
 
14
13
This reactor only works on FreeBSD and requires PyKQueue 1.3, which is
15
14
available at:  U{http://people.freebsd.org/~dwhite/PyKQueue/}
16
15
 
17
 
Maintainer: Itamar Shtull-Trauring
18
 
 
19
16
 
20
17
 
21
18
You're going to need to patch PyKqueue::
154
151
            self._updateRegistration(fd, EVFILT_WRITE, EV_DELETE)
155
152
 
156
153
    def removeAll(self):
157
 
        """Remove all selectables, and return a list of them."""
158
 
        if self.waker is not None:
159
 
            self.removeReader(self.waker)
160
 
        result = self._selectables.values()
161
 
        for fd in self._reads.keys():
162
 
            self._updateRegistration(fd, EVFILT_READ, EV_DELETE)
163
 
        for fd in self._writes.keys():
164
 
            self._updateRegistration(fd, EVFILT_WRITE, EV_DELETE)
165
 
        self._reads.clear()
166
 
        self._writes.clear()
167
 
        self._selectables.clear()
168
 
        if self.waker is not None:
169
 
            self.addReader(self.waker)
170
 
        return result
 
154
        """
 
155
        Remove all selectables, and return a list of them.
 
156
        """
 
157
        return self._removeAll(
 
158
            [self._selectables[fd] for fd in self._reads],
 
159
            [self._selectables[fd] for fd in self._writes])
171
160
 
172
161
 
173
162
    def getReaders(self):