summaryrefslogtreecommitdiff
path: root/README
blob: 3ed21a3635a621c977a7a3a0bd1bf08c709fde58 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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
42
43
44
45
46
47
48
49
50
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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
asyncio event loop scheduling callbacks in eventlet.

* Trollius project: http://trollius.readthedocs.org/
* aiogreen at PyPI: https://pypi.python.org/pypi/aiogreen


Installation
============

Requirements:

- eventlet 0.14 or newer
- asyncio or trollius:

  * Python 3.4 and newer: asyncio is now part of the stdlib
  * Python 3.3: need Tulip 0.4.1 or newer (pip install asyncio)
  * Python 2.6-3.2: need trollius 1.0 or newer (pip install trollius)

Type::

    pip install aiogreen

or::

    python setup.py install


Run tests
=========

Run tests with tox
------------------

The `tox project <https://testrun.org/tox/latest/>`_ can be used to build a
virtual environment with all runtime and test dependencies and run tests
against different Python versions (2.6, 2.7, 3.2, 3.3).

For example, to run tests with Python 2.7, just type::

    tox -e py27

To run tests against other Python versions:

* ``py26``: Python 2.6
* ``py27``: Python 2.7
* ``py27_patch``: Python 2.7 with eventlet monkey patching
* ``py32``: Python 3.2
* ``py33``: Python 3.3
* ``py34``: Python 3.4

Run tests manually
------------------

Run the following command from the directory of the aiogreen project:

    python runtests.py -r


Changelog
=========

Version 0.2 (development version)
---------------------------------

* Support also eventlet 0.14, not only eventlet 0.15 or newer
* Support eventlet with monkey-patching
* Rewrite the code handling file descriptors to ensure that the listener is
  only called once per loop iteration, to respect asyncio specification.
* Simplify the loop iteration: remove custom code to reuse instead the
  asyncio/trollius code (_run_once)
* Reuse call_soon, call_soon_threadsafe, call_at, call_later from
  asyncio/trollius, remove custom code
* sock_connect() is now asynchronous
* Add a suite of automated unit tests
* Fix EventLoop.stop(): don't stop immediatly, but schedule stopping the event
  loop with call_soon()
* Add tox.ini to run tests with tox
* Setting debug mode of the event loop doesn't enable "debug_blocking" of
  eventlet on Windows anymore, the feature is not implemented on Windows
  in eventlet.

2014-11-19: version 0.1
-----------------------

* First public release


Implemented
===========

Methods:

* call_at()
* call_later()
* call_soon()
* run_forever()
* run_in_executor()
* run_until_complete()
* create_connection(): TCP client
* stop()
* coroutines and tasks

Tests of aiogreen 0.1:

* Tested on Python 2.7, 3.3 and 3.5
* Tested on Linux and Windows
* Tested with Trollius 1.0, 1.0.1 and 1.0.2
* Tested with asyncio 0.4.1 and 3.4.2


To do (Not supported)
=====================

* run an event loop in a thread different than the main thread
* sockets: create_server, sock_recv
* pipes: connect_read_pipe
* subprocesses: need pipes
* signal handlers: add_signal_handler (only for pyevent hub?)
* tox.ini: add py33_patch. eventlet with Python 3 and monkey-patch causes
  an issue in importlib.


eventlet issues
===============

* eventlet monkey patching on Python 3 is incomplete. The most blocking issue
  is in the importlib: the thread module is patched to use greenthreads, but
  importlib really need to work on real threads.
* eventlet.tpool.setup() seems to be broken on Windows in eventlet 0.15:
  https://github.com/eventlet/eventlet/pull/167
* hub.debug_blocking is implemented with signal.alarm() which is is not
  available on Windows.


eventlet and Python 3
=====================

Issues:

* https://github.com/eventlet/eventlet/issues/6 (root py3 issue)
* https://github.com/eventlet/eventlet/issues/157 (py3 related?)
* https://github.com/eventlet/eventlet/issues/153 (py3 related?)

Pull requests:

* https://github.com/eventlet/eventlet/pull/99 : complete monkey-patching
* => commit: https://github.com/therve/eventlet/commit/9c3118162cf1ca1e50be330ba2a289f054c48d3c
* https://github.com/eventlet/eventlet/pull/160 (py3 related?)

OpenStack Kilo Summit:

* https://etherpad.openstack.org/p/kilo-oslo-python-3
* https://etherpad.openstack.org/p/kilo-oslo-oslo.messaging
* https://etherpad.openstack.org/p/py34-transition (tangentially related)