changelog.rst 27.9 KB
Newer Older
Denis Bilenko's avatar
Denis Bilenko committed
1 2
Changelog
=========
Denis Bilenko's avatar
Denis Bilenko committed
3

4 5
.. currentmodule:: gevent

Denis Bilenko's avatar
Denis Bilenko committed
6 7 8
Version 0.13.1
--------------

Denis Bilenko's avatar
Denis Bilenko committed
9 10 11 12 13
Release highlights:

- Deprecated :mod:`gevent.sslold` module.
- Fixed :meth:`Pool.join` to handle *raise_error* set to ``True`` properly, it used to raise :exc:`TypeError` (issue #36). Thanks to by **David Hain**.
- Fixed :mod:`gevent.wsgi` and :mod:`gevent.pywsgi` to join multiple ``Cookie`` headers (issue #40).
Denis Bilenko's avatar
Denis Bilenko committed
14
- Fixed :func:`select <gevent.select.select>` to recognize ``long`` arguments in addition to ``int``.
Denis Bilenko's avatar
Denis Bilenko committed
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
- Fixed :meth:`Semaphore.acquire` to return ``False`` when timeout expires instead of raising :exc:`AssertionError`. Patch by **Teh Ekik**.
- Updated :mod:`gevent.ssl` module to fully match the functionality of :mod:`ssl` on Python 2.7.
- Fixed :mod:`monkey` to patch :func:`socket.create_connection <gevent.socket.create_connection>`.

:mod:`gevent.socket` module:

- Overrode :meth:`socket.shutdown` method to interrupt read/write operations on socket.
- Fixed possible :exc:`NameError` in :meth:`socket.connect_ex` method. Patch by **Alexey Borzenkov**.
- Fixed socket leak in :func:`create_connection` function.
- Made :mod:`gevent.socket` import all public items from stdlib :mod:`socket` that do not do I/O.

:mod:`gevent.ssl` module:

- Imported a number of patches from stdlib by **Antoine Pitrou**:

  - Calling makefile() on an SSL object would prevent the underlying socket from being closed until all objects get truely destroyed (Python issue #5238).
  - SSL handshake would ignore the socket timeout and block indefinitely if the other end didn't respond (Python issue #5103).
  - When calling getpeername() in SSLSocket.__init__, only silence exceptions caused by the "socket not connected" condition.

- Added support for *ciphers* argument.
- Updated ``SSLSocket.send`` and ``SSLSocket.recv`` methods to match the behavior of stdlib :mod:`ssl` better.
- Fixed :class:`ssl.SSLObject` to delete events used by other greenlets when closing the instance (issue #34).

Miscellaneous:

- Made :class:`BaseServer` accept ``long`` values as *pool* argument in addition to ``int``.
- Made http._requests attribute public.
Denis Bilenko's avatar
Denis Bilenko committed
42
- Updated webchat example to use file on disk rather than in-memory sqlite database to avoid :exc:`OperationalError`.
Denis Bilenko's avatar
Denis Bilenko committed
43 44 45
- Fixed ``webproxy.py`` example to be runnable under external WSGI server.
- Fixed bogus failure in ``test__exc_info.py``.
- Added new test to check PEP8 conformance: ``xtest_pep8.py``
46
- Made :class:`BackdoorServer` close the connection on SystemExit and simplified the code
Denis Bilenko's avatar
Denis Bilenko committed
47

48 49 50
Version 0.13.0
--------------

51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138
Release highlights:

- Added :mod:`gevent.server` module with :class:`StreamServer` class for easy implementing of TCP and SSL servers.
- Added :mod:`gevent.baseserver` module with :class:`BaseServer` class.
- Added new implementation of :mod:`gevent.pywsgi` based on :mod:`gevent.server`. Contributed by **Ralf Schmitt**.
- Added :mod:`gevent.local` module. Fixed issue #24. Thanks to **Ted Suzman**.
- Fixed a number of bugs in :mod:`gevent.wsgi` module.
- Fixed issue #26: closing a socket now interrupts all pending read/write operations on it.
- Implemented workaround that prevents greenlets from leaking ``exc_info``.
- Fixed :meth:`socket.sendall` to use buffer object to prevent string copies.
- Made the interfaces of :mod:`gevent.wsgi` and :mod:`gevent.pywsgi` much more similar to each other.
- Fixed compilation on Windows with libevent-2. 
- Improved Windows compatibility. Fixed issue #30. Thanks to **Luigi Pugnetti**.
- Fixed compatibility with Python 2.7.

Backward-incompatible changes:

- Blocking is now the default behaviour for the :meth:`Greenlet.kill` method and other kill* methods.
- Changed the inteface of :class:`http.HTTPServer` to match the interface of other servers.
- Changed :class:`Pool`'s :meth:`spawn` method to block until there's a free slot.
- Removed deprecated :func:`backdoor.backdoor_server` function.
- Removed deprecated functions in :mod:`socket` module:

  - :func:`socket_bind_and_listen`
  - :func:`set_reuse_addr`
  - :func:`connect_tcp`
  - :func:`tcp_server`

- Removed deprecated :attr:`socket.fd` property.
- Deprecated use of negative numbers to indicate infinite timeout in :func:`core.event.add` and :func:`socket.wait_read` and similar. Use ``None`` from now on, which is compatible with the previous versions.
- Derived :class:`backdoor.BackdoorServer` from :class:`StreamServer` rather than from :class:`Greenlet`. This adds lots of new features and removes a few old ones.
- Removed non-standard :attr:`balance` property from :class:`Semaphore`.
- Removed :func:`start`, :func:`set_cb` and :func:`set_gencb` from :class:`core.http`.
- Removed :func:`set_closecb` from :class:`core.http_connection`. It is now used internally to detach the requests of the closed connections.
- Deprecated :mod:`rawgreenlet` module.
- Deprecated :func:`util.lazy_property`.
- Renamed :class:`GreenletSet` to :class:`Group`. The old name is currently available as an alias.

:mod:`gevent.socket` module:

- Fixed issues #26 and #34: closing the socket while reading/writing/connecting is now safe. Thanks to **Cyril Bay**.
- Imported :func:`getfqdn` from :mod:`socket` module.
- The module now uses ``sys.platform`` to detect Windows rather than :mod:`platform` module.
- Fixed issue #27: :func:`getaddrinfo` used to handle the case when *socktype* or *proto* were equal to ``0``. Thanks to **Randall Leeds**.

:mod:`gevent.coros` module:

- Added :class:`RLock` class.
- Added :class:`DummySemaphore` class.
- Fixed :class:`BoundedSemaphore` class to behave like :class:`threading.BoundedSemaphore` behaves.

:mod:`gevent.event` module:

- Made :meth:`Event.wait` return internal flag instead of ``None``.
- Made :meth:`AsyncResult.wait` return its ``value`` instead of ``None``.
- Added :meth:`ready` method as an alias for :meth:`is_set`.

:mod:`gevent.wsgi` module:

- Removed :class:`wsgi.buffer_proxy`.

:mod:`gevent.pywsgi` module:

- Rewritten to use :mod:`server` and not to depend on :mod:`BaseHTTPServer`.
- Changed the interface to match :mod:`wsgi` module.
  Removed :func:`server` function, add :class:`Server` class, added :class:`WSGIServer` class.
- Renamed :class:`HttpProtocol` to :class:`WSGIHandler`.
- Fixed compatibility with webob by allowing an optional argument to :meth:`readline`.

:mod:`gevent.core` module:

- Fixed reference leaks in :class:`event` class.
- Avoid Python name lookups when accessing EV_* constants from Cython code. Patch by **Daniele Varrazzo**.
- Added *persist* argument to :class:`read_event`, :class:`write_event` and :class:`readwrite_event`.
- Made all of the event loop callbacks clear the exception info before exiting.
- Added :attr:`flags_str` property to :class:`event`. It is used by ``__str__`` and ``__repr__``.
- :class:`buffer <core.buffer>`:

  - Added :meth:`detach` method.
  - Implemented iterator protocol.
  - Fixed :meth:`readline` and :meth:`readlines` methods.

- :class:`http_request`:

  - Fixed :meth:`detach` to detach input and output buffers too.
  - Changed the response to send 500 error upon deallocation, if no response was sent by the user.
  - Made :attr:`input_buffer` and :attr:`output_buffer` store and reuse the :class:`buffer` object they create.
  - Fixed :meth:`__str__` and meth:`__repr__` to include spaces where needed.
139 140
  - :class:`http` class no longer has :meth:`set_cb` and :meth:`set_gencb`. Instead its contructor accepts *handle* which will be called on each request.

141
:mod:`gevent.http` and :mod:`gevent.wsgi` modules:
142

143 144 145 146
- Made :class:`HTTPServer` use ``"Connection: close"`` header by default.
- Class :class:`HTTPServer` now derives from :class:`baseserver.BaseServer`. Thus its :meth:`start` method no longer accepts socket to listen on, it must be passed to the contructor.
- The *spawn* argument now accepts a :class:`Pool` instance. While the pool is full, the server replies with 503 error.
- The server no longer links to the greenlets it spawns to detect errors. Instead, it relies on :class:`http_request` which will send 500 reply when deallocated if the user hasn't send any.
147

148
Miscellaneous:
149
  
150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167
- Changed :mod:`gevent.thread` to use :class:`Greenlet` instead of raw greenlets. This means monkey patched thread will become :class:`Greenlet` too.
- Added :attr:`started` property to :class:`Greenlet`.
- Put common server code in :mod:`gevent.baseserver` module. All servers in gevent package are now derived from :class:`BaseServer`.
- Fixed issue #20: :func:`sleep` now raises :exc:`IOError` if passed a negative argument.
- Remove the code related to finding out libevent version from setup.py as macro ``USE_LIBEVENT_?`` is no longer needed to build ``gevent.core``.
- Increased default backlog in all servers (from 5 to 256). Thanks to **Nicholas Piël**.
- Fixed doc/conf.py to work in Python older than 2.6. Thanks to **Örjan Persson**.
- Silented SystemError raised in :mod:`backdoor` when a client typed ``quit()``.
- If importing :mod:`greenlet` failed with ImportError, keep the original error message,
  because sometimes the error originates in setuptools.
- Changed :func:`select.select` to return all the file descriptors signalled, not just the first one.
- Made :mod:`thread` (and thus monkey patched threads) to spawn :class:`Greenlet` instances, rather than raw greenlets.

Examples:

- Updated echoserver.py to use :class:`StreamServer`.
- Added geventsendfile.py.
- Added wsgiserver_ssl.py.
168 169 170 171 172 173 174
 
Thanks to **Ralf Schmitt** for :mod:`pywsgi`, a number of fixes for :mod:`wsgi`, help with
:mod:`baseserver` and :mod:`server` modules, improving setup.py and various other patches and suggestions.

Thanks to **Uriel Katz** for :mod:`pywsgi` patches.


Denis Bilenko's avatar
Denis Bilenko committed
175 176 177 178 179
Version 0.12.2
--------------

* Fixed http server to put the listening socket into a non-blocking mode. Contributed by **Ralf Schmitt**.

180

Denis Bilenko's avatar
Denis Bilenko committed
181 182 183
Version 0.12.1
--------------

Denis Bilenko's avatar
Denis Bilenko committed
184
* Removed a symlink from the distribution (that causes pip to fail). Thanks to **Brad Clements** for reporting it.
Denis Bilenko's avatar
Denis Bilenko committed
185 186 187 188 189 190 191
* setup.py: automatically create symlink from ``build/lib.../gevent/core.so`` to ``gevent/core.so``.
* :mod:`gevent.socket`: Improved compatibility with stdlib's socket:

  - Fixed :class:`socket <gevent.socket.socket>` to raise ``timeout("timed out")`` rather than simply ``timeout``.
  - Imported ``_GLOBAL_DEFAULT_TIMEOUT`` from standard :mod:`socket` module instead of creating a new object.


192 193 194
Version 0.12.0
--------------

195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278
Release highlights:

- Added :mod:`gevent.ssl` module.
- Fixed Windows compatibility (experimental).
- Improved performance of :meth:`socket.recv`, :meth:`socket.send` and similar methods.
- Added a new module - :mod:`dns` - with synchronous wrappers around libevent's DNS API.
- Added :class:`core.readwrite_event` and :func:`socket.wait_readwrite` functions.
- Fixed several incompatibilities of :mod:`wsgi` module with the WSGI spec.
- Deprecated :mod:`pywsgi` module.

:mod:`gevent.wsgi` module:

- Made ``env["REMOTE_PORT"]`` into a string.
- Fixed the server to close the iterator returned by the application.
- Made ``wsgi.input`` object iterable.

:mod:`gevent.core` module:

- Made DNS functions no longer accept/return IP addresses in dots-and-numbers format. They work
  with packed IPs now.
- Made DNS functions no longer accept additional arguments to pass to the callback.
- Fixed DNS functions to check the return value of the libevent functions and raise
  :exc:`IOError` if they failed.
- Added :func:`core.dns_err_to_string`
- Made core.event.cancel not to raise if event_del reports an error. instead, the return code is
  passed to the caller.
- Fixed minor issue in string representation of the events.

:mod:`gevent.socket` module:

- Fixed bug in socket.accept. It could return unwrapped socket instance if socket's timeout is 0.
- Fixed socket.sendall implementation never to call underlying socket's sendall.
- Fixed :func:`gethostbyname` and :func:`getaddrinfo` to call the stdlib if the passed hostname
  has no dots.
- Fixed :func:`getaddrinfo` to filter the results using *socktype* and *proto* arguments.
- Removed :func:`getnameinfo` as it didn't quite match the stdlib interface.
  Use :func:`dns.resolve_reverse` for reverse resolutions.
- Fixed :meth:`socket.connect_ex` to use cooperative :func:`gethostbyname`.
- Fixed :meth:`socket.dup` not to call underlying socket's :meth:`dup` (which is not available
  on Windows) but to use Python's reference counting similar to how the stdlib's socket
  implements :meth:`dup`
- Added *_sock* argument to :class:`socket`'s constructor. Passing the socket instance
  as first argument is no longer supported.
- Fixed :func:`socket.connect` to ignore ``WSAEINVAL`` on Windows.
- Fixed :func:`socket.connect` to use :func:`wait_readwrite` instead of :func:`wait_write`.
- Fixed :func:`socket.connect` to consult ``SO_ERROR``.
- Fixed :func:`socket.send` and :func:`socket.sendall` to support *flags* argument.
- Renamed :func:`socket_bind_and_listen` to :func:`socket.bind_and_listen`. The old name
  is still available as a deprecated alias.
- The underlying socket object is now stored as ``_sock`` property.
- Imported the constants and some utility functions from stdlib's :mod:`socket` into :mod:`gevent.socket`.
  (Thanks to **Matt Goodall** for the original patch).
- Renamed :meth:`wrap_ssl` to :meth:`ssl`. (the old name is still available but deprecated)
- Deprecated :func:`connect_tcp` and :func:`tcp_server`.
- Added :exc:`sslerror` to ``socket.__all__``.
- Removed :class:`GreenSocket` alias for socket class.
- Moved PyOpenSSL-based implementation of :func:`socket.ssl` into :mod:`gevent.oldssl` module.
  It's imported into :mod:`gevent.socket` if importing :mod:`gevent.ssl` fails.

Miscellaneous:

- Fixed Greenlet.spawn_link* and GreenletSet.spawn_link* classmethods not to assume anything
  about their arguments. (Thanks to **Marcus Cavanaugh** for pointing that out).
- Fixed :func:`select <gevent.select.select>` to clean up properly if event creation fails.
- Fixed :func:`select <gevent.select.select>` to raise :exc:`select.error` instead of :exc:`IOError`.
- Fixed setup.py to proceed with compilation even if libevent version cannot be determined.
  1.x.x is assumed in this case.
- Fixed compatibility of .pyx files with Cython 0.12.0
- Renamed arguments for :func:`select.select` to what they are called in the stdlib
- Removed internal function :func:`getLinkedCompleted` from :mod:`gevent.greenlet`
- Remove ``#warning`` directives from ``libevent.h``. They are not supported by vc90.
- Removed some deprecated stuff from :mod:`coros`.
- Internal class :class:`Waiter <gevent.hub.Waiter>` now stores the value if no one's waiting for it.
- Added ``testrunner.py`` script that replaces a bunch of small scripts that were used before.
- Removed ``is_secure`` attribute from sockets and ssl objects.
- Made :class:`Greenlet` not to print a traceback when a not-yet-started greenlet is killed.
- Added :class:`BackdoorServer` class to :mod:`backdoor`. Removed :func:`backdoor` function and deprecated :func:`backdoor_server` function.
- Removed ``__getattr__`` from socket class.
- Fixed :func:`monkey.patch_socket` not to fail if :func:`socket.ssl` is not present in :mod:`gevent.socket`.
- Added :func:`monkey.patch_ssl`.
- Added *aggressive* argument to :func:`monkey.patch_all`.
- Tests from stdlib no longer included in greentest package. Instead, there are number of stubs
  that import those tests from ``test`` package directly and run them in monkey patched environment.
- Added examples/process.py by **Marcus Cavanaugh**.
279 280


281 282 283 284 285 286 287 288 289 290
Version 0.11.2
--------------

* Fixed :mod:`wsgi` to unquote ``environ['PATH_INFO']`` before passing to application.
* Added ``SERVER_SOFTWARE`` variable to :mod:`wsgi` environ.

* Fixed bug in :meth:`JoinableQueue.task_done` that caused :class:`ValueError` to be raised incorrectly here.
* Fixed :mod:`gevent.socket` not to fail with :class:`ImportError` if Python was not built with ssl support.


Denis Bilenko's avatar
Denis Bilenko committed
291 292 293 294 295 296 297 298 299 300 301 302
Version 0.11.1
--------------

* Fixed bug in :func:`select.select` function. Passing non-empty list of write descriptors used to cause this function to fail.
* Changed setup.py to go ahead with the compilation even if the actual version of libevent cannot be determined (version 1.x.x is assumed in that case).

Contributed by **Ludvig Ericson**:

* Fixed :mod:`wsgi`'s ``start_response`` to recognize *exc_info* argument.
* Fixed setup.py to look for libevent.dylib rather than .so on Darwin platforms.


303 304 305 306 307
Version 0.11.0
--------------

* Fixed timeout bug in :func:`joinall`, :meth:`Greenlet.join`, :meth:`pool.Pool.join`: if timeout has expired
  it used to raise :class:`Timeout`; now it returns silently.
308
* Fixed :func:`signal` to run the signal handler in a new greenlet; it was run in the :class:`Hub` greenlet before.
309 310
* Fixed :meth:`Timeout.start_new`: if passed a :class:`Timeout` instance, it now calls its :meth:`start <Timeout.start>`
  method before returning it.
311 312
* Fixed :mod:`gevent.monkey` to patch :class:`threading.local` properly.
* Fixed :meth:`Queue.empty` and :meth:`Queue.full` to be compatible
313
  with the standard :mod:`Queue`. It tried to take into account the greenlets currently blocking on
314 315
  :meth:`get <Queue.get>`/:meth:`put <Queue.put>` which
  was not useful and hard to reason about. Now it simply compares :meth:`qsize <Queue.qsize>` to *maxsize*,
316
  which what the standard :mod:`Queue` does too.
317
* Fixed :class:`Event` to behave exactly like the standard :class:`threading.Event`:
318

319 320 321 322 323
  - :meth:`Event.set` does not accept a parameter anymore; it's now either set or not.
  - ``Event.get`` method is gone.
  - ``Event.set(); Event.clear()`` used to be a no-op; now it properly wakes up all the waiters.
  - :class:`AsyncResult` behaves exactly like before, but it does not inherit from :class:`Event` anymore
    and does miss ``clear()`` method.
324 325 326 327 328 329 330 331

* Renamed internal helpers :meth:`socket.wait_reader`/:meth:`socket.wait_writer` to :meth:`socket.wait_read`/:meth:`socket.wait_write`.
* Renamed :class:`gevent.socket.GreenSocket` to :class:`gevent.socket.socket`. ``GreenSocket`` is still available
  as an alias but will be removed in the future.
* :mod:`gevent.core` now includes wrappers for evbuffer, evdns, evhttp.
* Renamed the old ``gevent.wsgi`` to :mod:`gevent.pywsgi`.
* Added a new HTTP server :mod:`gevent.http` module based on libevent-http wrappers.
* Added a new WSGI server :mod:`gevent.wsgi` module based on :mod:`gevent.http`.
332
* Added evdns wrappers to :mod:`gevent.core` and DNS functions to :mod:`gevent.socket` module. Contributed by **Jason Toffaletti.**.
333 334 335
* Added a few a few options to ``setup.py`` to select a libevent library to compile against. Check them out with ``setup.py -h``.
* Added ``__all__`` to many modules that missed it.
* Converted the docstrings and the changelog to sphinx/rst markup.
336
* Added sphinx/rst documentation. It is available online at http://www.gevent.org.
337 338


Denis Bilenko's avatar
Denis Bilenko committed
339 340
Version 0.10.0
--------------
Denis Bilenko's avatar
Denis Bilenko committed
341

Denis Bilenko's avatar
Denis Bilenko committed
342 343 344 345 346 347 348
* Changed :class:`Timeout` API in a backward-incompatible way:
  :meth:`Timeout.__init__` does not start the timer immediately anymore;
  :meth:`Timeout.start` must be called explicitly.
  A shortcut - :meth:`Timeout.start_new` - is provided that creates and starts
  a :class:`Timeout`.
* Added :class:`gevent.Greenlet` class which is a subclass of greenlet that adds a few
  useful methods :meth:`join <Greenlet.join>`/:meth:`get <Greenlet.get>`/:meth:`kill <Greenlet.kill>`/:meth:`link <Greenlet.link>`.
349 350
* :func:`spawn` now returns :class:`Greenlet` instance. The old ``spawn``, which returns ``py.magic.greenlet``
  instance, can be still accessed as :meth:`spawn_raw`.
Denis Bilenko's avatar
Denis Bilenko committed
351

Denis Bilenko's avatar
Denis Bilenko committed
352
  .. note::
Denis Bilenko's avatar
Denis Bilenko committed
353

Denis Bilenko's avatar
Denis Bilenko committed
354
     The implementation of :class:`Greenlet` is an improvement on ``proc`` module, with these bugs fixed:
Denis Bilenko's avatar
Denis Bilenko committed
355

Denis Bilenko's avatar
Denis Bilenko committed
356 357 358 359 360 361 362 363 364
     * Proc was not a subclass of greenlet which makes :func:`getcurrent` useless and using
       Procs as keys in dict impossible.
     * Proc executes links sequentially, so one could block the rest from being
       executed. :class:`Greenlet` executes each link in a new greenlet by default, unless
       it is set up with :class:`Greenlet.rawlink` method.
     * Proc cannot be easily subclassed. To subclass :class:`Greenlet`, override its _run
       and __init__ methods.

* Added :class:`pool.Pool` class with the methods compatible to the standard :mod:`multiprocessing.pool`:
365 366 367
  :meth:`apply <Pool.apply>`, :meth:`map <Pool.map>` and others.
  It also has :meth:`spawn <Pool.spawn>` method which is always async and returns a
  :class:`Greenlet` instance.
Denis Bilenko's avatar
Denis Bilenko committed
368 369
* Added :mod:`gevent.event` module with 2 classes: :class:`Event` and :class:`AsyncResult`.
  :class:`Event` is a drop-in replacement for :class:`threading.Event`, supporting
370 371
  :meth:`set <Event.set>`/:meth:`wait <Event.wait>`/``get`` methods. :class:`AsyncResult`
  is an extension of :class:`Event` that supports exception passing via :meth:`set_exception <AsyncResult.set_exception>` method.
Denis Bilenko's avatar
Denis Bilenko committed
372 373 374
* Added :class:`queue.JoinableQueue` class with :meth:`task_done <queue.JoinableQueue.task_done>`
  and :meth:`join <queue.JoinableQueue.join>` methods.
* Renamed ``core.read`` and ``core.write`` classes to :class:`core.read_event` and :class:`core.write_event`.
Denis Bilenko's avatar
Denis Bilenko committed
375
* :mod:`gevent.pywsgi`: pulled **Mike Barton's** eventlet patches that fix double content-length issue.
376
* Fixed ``setup.py`` to search more places for system libevent installation.
Denis Bilenko's avatar
Denis Bilenko committed
377 378
  This fixes 64bit CentOS 5.3 installation issues, hopefully covers other platforms
  as well.
Denis Bilenko's avatar
Denis Bilenko committed
379 380

The following items were added to the gevent top level package:
Denis Bilenko's avatar
Denis Bilenko committed
381

Denis Bilenko's avatar
Denis Bilenko committed
382 383 384 385 386 387 388 389
- :func:`spawn_link`
- :func:`spawn_link_value`
- :func:`spawn_link_exception`
- :func:`spawn_raw`
- :func:`joinall`
- :func:`killall`
- :class:`Greenlet`
- :exc:`GreenletExit`
390
- :mod:`core`
Denis Bilenko's avatar
Denis Bilenko committed
391 392

The following items were marked as deprecated:
Denis Bilenko's avatar
Denis Bilenko committed
393

394
- gevent.proc module (:class:`wrap_errors` helper was moved to :mod:`util` module)
Denis Bilenko's avatar
Denis Bilenko committed
395 396
- gevent.coros.event
- gevent.coros.Queue and gevent.coros.Channel
Denis Bilenko's avatar
Denis Bilenko committed
397

Denis Bilenko's avatar
Denis Bilenko committed
398
Internally, ``gevent.greenlet`` was split into a number of modules:
Denis Bilenko's avatar
Denis Bilenko committed
399

Denis Bilenko's avatar
Denis Bilenko committed
400 401 402
- :mod:`gevent.hub` provides :class:`Hub` class and basic utilities, like :func:`sleep`;
  :class:`Hub` is now a subclass of greenlet.
- :mod:`gevent.timeout` provides :class:`Timeout` and :func:`with_timeout`
403
- :mod:`gevent.greenlet` provides :class:`Greenlet` class and helpers like :func:`joinall`
Denis Bilenko's avatar
Denis Bilenko committed
404 405
  and :func:`killall`.
- :mod:`gevent.rawgreenlet` contains the old "polling" versions of
406
  :func:`joinall <rawgreenlet.joinall>` and :func:`killall <rawgreenlet.killall>` (they do not need :meth:`link <Greenlet.link>`
Denis Bilenko's avatar
Denis Bilenko committed
407
  functionality and work with any greenlet by polling their status and sleeping in a loop)
Denis Bilenko's avatar
Denis Bilenko committed
408 409


Denis Bilenko's avatar
Denis Bilenko committed
410
Thanks to **Jason Toffaletti** for reporting the installation issue and providing a
Denis Bilenko's avatar
Denis Bilenko committed
411
test case for WSGI double content-length header bug.
Denis Bilenko's avatar
Denis Bilenko committed
412 413


Denis Bilenko's avatar
Denis Bilenko committed
414 415
Version 0.9.3
-------------
Denis Bilenko's avatar
Denis Bilenko committed
416

417
* Fixed all known bugs in the :mod:`gevent.queue` module and made it 2.4-compatible.
418
  :class:`LifoQueue` and :class:`PriorityQueue` are implemented as well.
Denis Bilenko's avatar
Denis Bilenko committed
419
  :mod:`gevent.queue` will deprecate both ``coros.Queue`` and ``coros.Channel``.
420
* Fixed :class:`Timeout` to raise itself by default. ``TimeoutError`` is gone.
Denis Bilenko's avatar
Denis Bilenko committed
421 422 423 424 425 426 427 428 429 430 431 432
  Silent timeout is now created by passing ``False`` instead of ``None``.
* Fixed bug in :func:`gevent.select.select` where it could silent the wrong timeout.
* :func:`spawn` and :func:`spawn_later` now avoid creating a closure and this decreases spawning
  time by 50%.
* ``kill``'s and ``killall``'s *wait* argument was renamed to *block*. The polling is now
  implemented by ``greenlet.join`` and ``greenlet.joinall`` functions and it become more
  responsive, with gradual increase of sleep time.
* Renamed ``proc.RunningProcSet`` to ``proc.ProcSet``.
* Added :func:`shutdown` function, which blocks until libevent has finished dispatching the events.
* The return value of ``event_add`` and ``event_del`` in core.pyx are now checked properly
  and :exc:`IOError` is raised if they have failed.
* Fixed backdoor.py, accidentally broken in the previous release.
Denis Bilenko's avatar
Denis Bilenko committed
433

Denis Bilenko's avatar
Denis Bilenko committed
434

Denis Bilenko's avatar
Denis Bilenko committed
435 436
Version 0.9.2
-------------
Denis Bilenko's avatar
Denis Bilenko committed
437

Denis Bilenko's avatar
Denis Bilenko committed
438 439 440
* Simplified :mod:`gevent.socket`'s implementation and fixed SSL
  bug reported on eventletdev by **Cesar Alaniz** as well as failures
  in test_socket_ssl.py.
441 442 443
* Removed ``GreenSocket.makeGreenFile``; Use :meth:`socket.socket.makefile` that returns _fileobject
  and is available on both :class:`GreenSocket <gevent.socket.socket>` and :class:`GreenSSL <gevent.socket.GreenSSL>`.
  socket.py still a work in progress.
Denis Bilenko's avatar
Denis Bilenko committed
444 445 446
* Added new :class:`core.active_event` class that takes advantage of libevent's event_active function.
  ``core.active_event(func)`` schedules func to be run in this event loop iteration as opposed
  to ``core.timer(0, ...)`` which schedules an event to be run in the next iteration.
447
  :class:`active_event` is now used throughout the library wherever ``core.timer(0, ....)`` was previously used.
Denis Bilenko's avatar
Denis Bilenko committed
448 449 450 451 452 453
  This results in :func:`spawn` being at least 20% faster compared to `Version 0.9.1`_ and twice as fast compared to
  eventlet. (The results are obtained with bench_spawn.py script in ``greentest/`` directory)
* Added boolean parameter *wait* to :func:`kill` and :func:`killall` functions. If set to ``True``, it makes the
  function block until the greenlet(s) is actually dead. By default, :func:`kill` and :func:`killall` are asynchronous,
  i.e. they don't unschedule the current greenlet.
* Added a few new properties to :class:`gevent.core.event`: :attr:`fd <event.fd>`, :attr:`events <event.events>`,
454
  :attr:`events_str <event.events_str>` and :attr:`flags <event.flags>`. It also has
455
  :meth:`__enter__ <event.__enter__>` and :meth:`__exit__ <event.__exit__>` now, so it can be used as a context manager. :class:`event`'s :attr:`callback <event.callback>` signature has changed from ``(event, fd, evtype)`` to ``(event, evtype)``.
Denis Bilenko's avatar
Denis Bilenko committed
456 457 458 459 460 461 462 463 464 465
* Fixed :class:`Hub`'s mainloop to never return successfully as this will screw up main greenlet's ``switch()`` call.
  Instead of returning it raises :class:`DispatchExit`.
* Added :func:`reinit` function - wrapper for libevent's ``event_reinit``.
  This function is a must have at least for daemons, as it fixes ``epoll`` and some others
  eventloops to work after ``fork``.
* Trying to use gevent in another thread will now raise an exception immediately,
  since it's not implemented.
* Added a few more convenience methods ``spawn_link[exception/value]`` to ``proc.RunningProcSet``.
* Fixed setup.py not to depend on setuptools.
* Removed ``gevent.timeout`` (use :class:`gevent.Timeout`)
Denis Bilenko's avatar
Denis Bilenko committed
466 467


Denis Bilenko's avatar
Denis Bilenko committed
468 469
Version 0.9.1
-------------
Denis Bilenko's avatar
Denis Bilenko committed
470

471
* Fixed compilation with libevent-1.3 (Thanks to **Litao Wei** for reporting the problem.)
472
* Fixed :class:`Hub` to recover silently after ``event_dispatch()`` failures (I've seen this
Denis Bilenko's avatar
Denis Bilenko committed
473 474
  happen after ``fork`` even though ``event_reinit()`` is called as necessary). The end result is that :func:`fork`
  now works more reliably, as detected by ``test_socketserver.py`` - it used to fail occasionally, now it does not.
475 476
* Reorganized the package, most of the stuff from ``gevent/__init__.py`` was moved to ``gevent/greenlet.py``.
  ``gevent/__init__.py`` imports some of it back but not everything.
Denis Bilenko's avatar
Denis Bilenko committed
477 478
* Renamed ``gevent.timeout`` to :class:`gevent.Timeout`. The old name is available as an alias.
* Fixed a few bugs in :class:`queue.Queue`.
479
  Added test_queue.py from standard tests to check how good is :class:`queue.Queue` a replacement
Denis Bilenko's avatar
Denis Bilenko committed
480 481 482 483 484
  for a standard :mod:`Queue` (not good at all, timeouts in :meth:`queue.Queue.put` don't work yet)
* :mod:`monkey` now patches ssl module when on 2.6 (very limited support).
* Improved compatibility with Python 2.6 and Python 2.4.
* Greenlet installed from PyPI (without py.magic prefix) is properly recognized now.
* core.pyx was accidentally left out of the source package, it's included now.
485
* :class:`GreenSocket <socket.socket>` now wraps a ``socket`` object from ``_socket`` module rather
Denis Bilenko's avatar
Denis Bilenko committed
486 487 488 489 490 491 492
  than from :mod:`socket`.


Version 0.9.0
-------------

Started as eventlet_ 0.8.11 fork, with the intention to support only libevent as a backend.
Denis Bilenko's avatar
Denis Bilenko committed
493 494 495
Compared to eventlet, this version has a much simpler API and implementation and a few
severe bugs fixed, namely

Denis Bilenko's avatar
Denis Bilenko committed
496
* full duplex in sockets, i.e. ``read()`` and ``write()`` on the same fd do not cancel one another
497 498 499 500
* :meth:`GreenSocket.close <socket.socket.close>` does not hang as it could with eventlet.

There's a test in my repo of eventlet that reproduces both of them:
http://bitbucket.org/denis/eventlet/src/tip/greentest/test__socket.py
Denis Bilenko's avatar
Denis Bilenko committed
501 502 503 504 505 506

Besides having less bugs and less code to care about the goals of the fork are:

* piggy-back on libevent as much as possible (use its http and dns code)
* use the interfaces and conventions from the standard Python library where possible

Denis Bilenko's avatar
Denis Bilenko committed
507
.. _eventlet: http://bitbucket.org/denis/eventlet