summaryrefslogtreecommitdiffstats
path: root/Lib/asyncio/base_events.py
Commit message (Collapse)AuthorAgeFilesLines
...
* Issue #20055: Fix BaseEventLoop.stop() docstring, incomplete sentence.Victor Stinner2014-07-241-3/+3
| | | | Patch written by Saimadhav Heblikar.
* asyncio: sync with TulipVictor Stinner2014-07-141-39/+92
| | | | | | | | | | | | | | | | | | | | * Tulip issue #184: Log subprocess events in debug mode - Log stdin, stdout and stderr transports and protocols - Log process identifier (pid) - Log connection of pipes - Log process exit - Log Process.communicate() tasks: feed stdin, read stdout and stderr - Add __repr__() method to many classes related to subprocesses * Add BaseSubprocessTransport._pid attribute. Store the pid so it is still accessible after the process exited. It's more convinient for debug. * create_connection(): add the socket in the "connected to" debug log * Clean up some docstrings and comments. Remove unused unimplemented _read_from_self().
* asyncio: sync with TulipVictor Stinner2014-07-121-4/+52
| | | | | | | | | | | | | | | | | | | * Tulip issue #183: log socket events in debug mode - Log most important socket events: socket connected, new client, connection reset or closed by peer (EOF), etc. - Log time elapsed in DNS resolution (getaddrinfo) - Log pause/resume reading - Log time of SSL handshake - Log SSL handshake errors - Add a __repr__() method to many classes * Fix ProactorEventLoop() in debug mode. ProactorEventLoop._make_self_pipe() doesn't call call_soon() directly because it checks for the current loop which fails, because the method is called to build the event loop. * Cleanup _ProactorReadPipeTransport constructor. Not need to set again _read_fut attribute to None, it is already done in the base class.
* asyncio: improve the documentation of serversVictor Stinner2014-07-111-1/+3
| | | | | | - Fix the documentation of Server.close(): it closes sockets - Replace AbstractServer with Server - Document Server.sockets attribute
* asyncio, Tulip issue 180: Make Server attributes and methods privateVictor Stinner2014-07-111-20/+21
| | | | | | | - loop, waiters and active_count attributes are now private - attach(), detach() and wakeup() methods are now private The sockets attribute remains public.
* asyncio: sync with TulipVictor Stinner2014-07-111-7/+14
| | | | | | | | | | * Tulip issue #182: Improve logs of BaseEventLoop._run_once() - Don't log non-blocking poll - Only log polling with a timeout if it gets events or if it timed out after more than 1 second. * Fix some pyflakes warnings: remove unused imports
* asyncio: sync with TulipVictor Stinner2014-07-101-1/+4
| | | | | | | - repr(Task) and repr(CoroWrapper) now also includes where these objects were created. If the coroutine is not a generator (don't use "yield from"), use the location of the function, not the location of the coro() wrapper. - Fix create_task(): truncate the traceback to hide the call to create_task().
* asyncion, Tulip issue 181: BaseEventLoop.create_datagram_endpoint() now waitsVictor Stinner2014-07-081-2/+5
| | | | | until protocol.connection_made() has been called. Document also why transport constructors use a waiter.
* asyncio: sync with TulipVictor Stinner2014-07-081-0/+6
| | | | | | | | | | | - Tulip issue 185: Add a create_task() method to event loops. The create_task() method can be overriden in custom event loop to implement their own task class. For example, greenio and Pulsar projects use their own task class. The create_task() method is now preferred over creating directly task using the Task class. - tests: fix a warning - fix typo in the name of a test function - Update AbstractEventLoop: add new event loop methods; update also the unit test
* Issue #21163: BaseEventLoop.run_until_complete() and test_utils.run_briefly()Victor Stinner2014-06-301-0/+7
| | | | | don't log the "destroy pending task" message anymore. The log is redundant for run_until_complete() and useless in run_briefly().
* asyncio: sync with TulipVictor Stinner2014-06-301-2/+2
| | | | | | | | | | | - Sort imports - Simplify/optimize iscoroutine(). Inline inspect.isgenerator(obj): replace it with isinstance(obj, types.GeneratorType) - CoroWrapper: check at runtime if Python has the yield-from bug #21209. If Python has the bug, check if CoroWrapper.send() was called by yield-from to decide if parameters must be unpacked or not. - Fix "Task was destroyed but it is pending!" warning in test_task_source_traceback()
* asyncio: sync with Tulip, add a new asyncio.coroutines moduleVictor Stinner2014-06-281-13/+15
|
* asyncio, Tulip issue 137: In debug mode, save traceback where Future, Task andVictor Stinner2014-06-271-3/+23
| | | | | | | | | | | Handle objects are created. Pass the traceback to call_exception_handler() in the 'source_traceback' key. The traceback is truncated to hide internal calls in asyncio, show only the traceback from user code. Add tests for the new source_traceback, and a test for the 'Future/Task exception was never retrieved' log.
* asyncio: Fix BaseEventLoop._assert_is_current_event_loop(): get_event_loop()Victor Stinner2014-06-231-2/+5
| | | | raises an exception if there is no current loop
* asyncio, Tulip issue 171: BaseEventLoop.close() now raises an exception if theVictor Stinner2014-06-221-0/+4
| | | | | event loop is running. You must first stop the event loop and then wait until it stopped, before closing it.
* asyncio, Tulip issue 172: only log selector timing in debug modeVictor Stinner2014-06-221-2/+1
|
* asyncio: Enable the debug mode of event loops when the PYTHONASYNCIODEBUGVictor Stinner2014-06-221-1/+2
| | | | environment variable is set
* asyncio: BaseEventLoop._assert_is_current_event_loop() now only raises anVictor Stinner2014-06-221-1/+2
| | | | | | | | | | | | exception if the current loop is not None. Guido van Rossum wrote: "The behavior that you can set the loop to None (and keep track of it explicitly) is part of the spec, and this should still be supported even in debug mode. The behavior that we raise an error if you are caught having multiple active loops per thread is just a debugging heuristic, and it shouldn't break code that follows the spec."
* asyncio, Tulip issue 105: in debug mode, log callbacks taking more than 100 msVictor Stinner2014-06-201-5/+27
| | | | to be executed.
* Tulip issue 83: document more asyncio functions in docstringsVictor Stinner2014-06-191-3/+18
|
* Issue #21326: Add a new is_closed() method to asyncio.BaseEventLoopVictor Stinner2014-06-101-0/+19
| | | | | | | | | | | Add BaseEventLoop._closed attribute and use it to check if the event loop was closed or not, instead of checking different attributes in each subclass of BaseEventLoop. run_forever() and run_until_complete() methods now raise a RuntimeError('Event loop is closed') exception if the event loop was closed. BaseProactorEventLoop.close() now also cancels "accept futures".
* Issue #21119: asyncio now closes sockets on errorsVictor Stinner2014-06-031-0/+8
| | | | | | Fix ResourceWarning: create_connection(), create_datagram_endpoint() and create_unix_server() methods of event loop now close the newly created socket on error.
* asyncio: Upstream issue #167: remove dead code, by Marc Schlaich.Guido van Rossum2014-05-101-5/+1
|
* asyncio: Ensure call_soon(), call_later() and call_at() are invoked on currentVictor Stinner2014-03-211-1/+22
| | | | | | loop in debug mode. Raise a RuntimeError if the event loop of the current thread is different. The check should help to debug thread-safetly issue. Patch written by David Foster.
* asyncio: _check_resolved_address() must also accept IPv6 without flow_info andVictor Stinner2014-02-201-1/+1
| | | | scope_id: (host, port).
* asyncio: Fix _check_resolved_address() for IPv6 addressVictor Stinner2014-02-201-2/+5
|
* asyncio, Tulip issue #136: Add get/set_debug() methods to BaseEventLoopTests.Victor Stinner2014-02-191-0/+7
| | | | | | Add also a PYTHONASYNCIODEBUG environment variable to debug coroutines since Python startup, to be able to debug coroutines defined directly in the asyncio module.
* asyncio: pep8-ify the code.Yury Selivanov2014-02-191-5/+6
|
* asyncio: New error handling API. Issue #20681.Yury Selivanov2014-02-181-2/+94
|
* asyncio: Add support for UNIX Domain Sockets.Yury Selivanov2014-02-181-0/+7
|
* ayncio, Tulip issue 129: BaseEventLoop.sock_connect() now raises an error ifVictor Stinner2014-02-131-0/+25
| | | | | the address is not resolved (hostname instead of an IP address) for AF_INET and AF_INET6 address families.
* Issue #20505: Remove debug codeVictor Stinner2014-02-111-20/+0
|
* asyncio, Tulip issue 130: Add more checks on subprocess_exec/subprocess_shellVictor Stinner2014-02-111-3/+9
| | | | parameters
* asyncio, Tulip issue 126: call_soon(), call_soon_threadsafe(), call_later(),Victor Stinner2014-02-111-0/+6
| | | | | call_at() and run_in_executor() now raise a TypeError if the callback is a coroutine function.
* Issue #20505: use also the monotonic time to decide if asyncio debug tracesVictor Stinner2014-02-111-3/+4
| | | | should be printed
* Issue #20505: Oops, only print debug info if selector.select(timeout) took lessVictor Stinner2014-02-111-1/+1
| | | | than timeout
* Issue #20505: Improve debug info in asyncio event loopVictor Stinner2014-02-111-5/+18
|
* Issue #20505: BaseEventLoop uses again the resolution of the clock to decide ifVictor Stinner2014-02-101-2/+3
| | | | scheduled tasks should be executed or not.
* Issue #20505: Add debug info to analyze sporaric failures ofVictor Stinner2014-02-101-0/+6
| | | | test_timeout_rounding() on Windows XP buildbots.
* asyncio: Tulip issue 112: Inline make_handle() into Handle constructorVictor Stinner2014-02-091-1/+1
|
* Issue #20505: Remove resolution and _granularity from selectors and asyncioVictor Stinner2014-02-071-12/+1
| | | | | * Remove selectors.BaseSelector.resolution attribute * Remove asyncio.BaseEventLoop._granularity attribute
* Issue #20505: add debug infoVictor Stinner2014-02-071-0/+10
|
* Issue #20452: Remove debug code, no more neededVictor Stinner2014-01-311-9/+1
|
* asyncio: Fix error message in BaseEventLoop.subprocess_shell(). Patch writtenVictor Stinner2014-01-311-1/+1
| | | | by Vajrasky Kok.
* Issue #20452: select and selectors round (again) timeout away from zero forVictor Stinner2014-01-311-10/+5
| | | | | | poll and epoll Improve also debug info to analyze the issue
* Issue #20452: Oops, fix debug code :-/Victor Stinner2014-01-311-5/+10
| | | | Add also event more debug info
* Issue #20452: add more info in case of test_asyncio failure to try to debug theVictor Stinner2014-01-311-1/+9
| | | | failure on buildbot "x86 Ubuntu Shared 3.x"
* asyncio: subprocess_shell() and subprocess_exec() now raise ValueError ↵Victor Stinner2014-01-291-5/+14
| | | | | | instead of assert. Moreover, bufsize different than 0 is now considered as an error.
* Merge latest Tulip into asyncioVictor Stinner2014-01-251-7/+2
| | | | | | - Make the new granularity attribute private - Simplify BaseEventLoop._run_once(): avoid math.ceil(), use simple arithmetic instead
* Issue #20311: asyncio: Add a granularity attribute to BaseEventLoop: maximumVictor Stinner2014-01-251-0/+6
| | | | | | 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.