Commit graph

251 commits

Author SHA1 Message Date
Guido van Rossum
48c66c3dd8 asyncio: wait_for() now accepts None as timeout (Victor Stinner). 2014-01-29 14:30:38 -08:00
Guido van Rossum
1e9a446ebe asyncio: Pass through pause/resume from subprocess pipe proto to subprocess proto. Also kill dummy eof_received(). 2014-01-29 14:28:15 -08:00
Guido van Rossum
4d62d0b353 asyncio: Refactor drain logic in streams.py to be reusable. 2014-01-29 14:24:45 -08:00
Victor Stinner
aaabc4fdca asyncio: Get rid of _try_connected(). 2014-01-29 14:22:56 -08:00
Guido van Rossum
47fb97e4e6 asyncio: Add write flow control to unix pipes. 2014-01-29 13:20:39 -08:00
Guido van Rossum
3ccead1f6a asyncio: Refactoring: move write flow control to a subclass/mixin. 2014-01-29 13:15:59 -08:00
Victor Stinner
63b4d4b494 asyncio: _fatal_error() of _UnixWritePipeTransport and _ProactorBasePipeTransport shouldn't log BrokenPipeError nor ConnectionResetError.
(Same behaviour as _SelectorTransport._fatal_error().)
2014-01-29 13:12:03 -08:00
Victor Stinner
7aedea40d6 asyncio: remove temporary aliases 2014-01-28 00:09:24 +01:00
Andrew Svetlov
0742cae335 Merge latest Tulip into asyncio 2014-01-26 18:36:01 +02:00
Guido van Rossum
fef7098ef9 asyncio: Rename {Empty,Full} to {QueueEmpty,QueueFull} and no longer get them from queue.py. 2014-01-25 17:24:51 -08:00
Guido van Rossum
ab3c88983b asyncio: Locks refactor: use a separate context manager; remove Semaphore._locked. 2014-01-25 16:51:57 -08:00
Guido van Rossum
ab27a9fc4b asyncio: Fix race in FastChildWatcher (by its original author, Anthony Baire). 2014-01-25 16:32:17 -08:00
Victor Stinner
669eeaf933 Merge latest Tulip into asyncio
- Make the new granularity attribute private
- Simplify BaseEventLoop._run_once(): avoid math.ceil(), use simple arithmetic
  instead
2014-01-26 00:02:31 +01:00
Victor Stinner
128ee220e2 asyncio: Don't export BaseEventLoop, BaseSelectorEventLoop nor
BaseProactorEventLoop

Import them from submodules if you really need them.
2014-01-25 22:22:18 +01:00
Victor Stinner
8dffc456d7 Update asyncio from the Tulip project
Major changes:

- StreamReader.readexactly() now raises an IncompleteReadError if the
  end of stream is reached before we received enough bytes, instead of
  returning less bytes than requested.

- Unit tests use the main asyncio module instead of submodules like events

- _UnixWritePipeTransport now also supports character devices, as
  _UnixReadPipeTransport. Patch written by Jonathan Slenders.

- Export more symbols: BaseEventLoop, BaseProactorEventLoop,
  BaseSelectorEventLoop, Queue and Queue sublasses, Empty, Full
2014-01-25 15:32:06 +01:00
Victor Stinner
75a5ec88ff Fix asyncio tests: define resolution 2014-01-25 15:31:06 +01:00
Victor Stinner
f67255ab94 Issue #20311: asyncio: Add a granularity attribute to BaseEventLoop: maximum
between the resolution of the BaseEventLoop.time() method and the resolution of
the selector. The granuarility is used in the scheduler to round time and
deadline.
2014-01-25 15:01:33 +01:00
Victor Stinner
421e49b5c1 asyncio: wait_for() now cancels the future on timeout. Patch written by Gustavo
Carneiro.
2014-01-23 17:40:59 +01:00
Victor Stinner
183e347796 asyncio (Tulip issue 110): StreamReader.read() and StreamReader.readline() now
raise a RuntimeError, instead of using an assertion, if another coroutine is
already waiting for incoming data
2014-01-23 17:40:03 +01:00
Victor Stinner
3eb45d3eae asyncio: Fix open_connection() documentation, writer is a StreamWriter 2014-01-23 10:20:18 +01:00
Victor Stinner
4a2dbeb0d3 asyncio: Cleanup logging in BaseEventLoop._run_once()
logger.log() is now responsible to format the timeout. It might be faster if
the log is disabled for DEBUG level, but it's also more readable and fix
an issue with Python 2.6 in the Trollius project.
2014-01-22 12:26:01 +01:00
Victor Stinner
22463aa947 Close #20275: Optimize BaseEventLoop._run_once()
Logger.log() is "slow", logger.isEnabledFor() is faster and the logger is
disabled in most cases. A microbenchmark executing 100,000 dummy tasks is 22%
faster with this change.
2014-01-20 23:56:40 +01:00
Guido van Rossum
e1f554490d asyncio: Reincarnate CoroWrapper's docstring as a comment. 2014-01-16 11:05:23 -08:00
Victor Stinner
bac7793b5b asyncio: Fix CoroWrapper (fix my previous commit)
Add __name__ and __doc__ to __slots__
2014-01-16 01:55:29 +01:00
Victor Stinner
4d7a29c5de asyncio: Fix a typo in CoroWrapper
__slot__ => __slots__
2014-01-16 01:38:24 +01:00
Victor Stinner
7de2646cdf Cleanup properly proactor event loop
* store the "self reading" future when the "self pipe" is closed (when the
  event loop is closed)
* store "accept" futures to cancel them when we stop serving
* close the "accept socket" if the "accept future" is cancelled

Fix many warnings which can be seen when unit tests are run in verbose mode.
2014-01-11 00:03:21 +01:00
Guido van Rossum
02757ea7e9 asyncio: Minimal pty support in UNIX read pipe, by Jonathan Slenders. 2014-01-10 13:30:04 -08:00
Guido van Rossum
4835f17c24 asyncio: Fix race in subprocess transport, by Victor Stinner. 2014-01-10 13:28:59 -08:00
Guido van Rossum
efef9d3f25 asyncio: Tiny cleanup in streams.py. 2014-01-10 13:26:38 -08:00
Guido van Rossum
2407f3bb1b asyncio: Don't special-case GeneratorExit in Condition.wait(). 2014-01-10 13:25:38 -08:00
Guido van Rossum
6188bd498f Fix typo in asyncio/streams.py. 2014-01-07 17:03:26 -08:00
Guido van Rossum
3845521b4b asyncio: Fix deadlock in readexactly(). Fixes issue #20154. 2014-01-06 16:09:18 -08:00
Victor Stinner
6f055e73df asyncio: make PY34 symbol private (rename it to _PY34) 2014-01-02 18:41:34 +01:00
Guido van Rossum
68816ef058 Export asyncio.iscoroutine[function]. 2013-12-28 08:06:40 -10:00
Guido van Rossum
68600c73bf asyncio: Fix space in log message about poll time. 2013-12-20 20:37:41 -08:00
Victor Stinner
e40c078627 Issue #19967: Defer the formating of the traceback in asyncio.Future destructor 2013-12-21 00:19:33 +01:00
Guido van Rossum
ac97bf4fd9 asyncio: Export all abstract protocol and transport classes. Fixes issue #20029. 2013-12-20 14:16:21 -08:00
Guido van Rossum
9ba75db3c5 asyncio: Clean up formatting. 2013-12-19 13:49:32 -08:00
Victor Stinner
4c3c699e62 Close #19967: Thanks to the PEP 442, asyncio.Future can use a destructor in
Python 3.4 to log "uncatched" exceptions, instead of the dedicated
_TracebackLogger class.
2013-12-19 22:42:40 +01:00
Guido van Rossum
994bf4332f Shorten lines. 2013-12-19 12:47:38 -08:00
Victor Stinner
2748bc735e asyncio: remove references to the Tulip project, rename Tulip to asyncio.
Patch written by Vajrasky Kok.
2013-12-13 10:57:04 +01:00
Victor Stinner
782b8e4b88 Remove a duplicated import 2013-12-07 15:02:09 +01:00
Guido van Rossum
1a605ed5a3 asyncio: Add Task.current_task() class method. 2013-12-06 12:57:40 -08:00
Christian Heimes
c9a87e6bbe fix cert names for asyncio test 2013-12-06 02:58:23 +01:00
Christian Heimes
6d8c1abb00 Issue #19509: Finish implementation of check_hostname
The new asyncio package now supports the new feature and comes with additional tests for SSL.
2013-12-06 00:23:13 +01:00
Charles-François Natali
74e7cf3f46 Issue #19850: asyncio: Set SA_RESTART when registering a signal handler to
limit EINTR occurrences.
2013-12-05 22:47:19 +01:00
Guido van Rossum
ebb8e58f0a asyncio: Write flow control for proactor event loop. 2013-12-04 12:12:07 -08:00
Victor Stinner
cf6f72e329 Fix typo in asyncio.AbstractServer documentation 2013-12-03 18:23:52 +01:00
Guido van Rossum
f10345e102 asyncio: Improve default writelines(). 2013-12-02 18:36:30 -08:00
Victor Stinner
10a8e6ab7b asyncio: replace our with asynchronous in docstring 2013-12-02 14:31:43 +01:00