Wykres commitów

87 Commity (09c59c47042b61e96519e22d451d36d86b37a518)

Autor SHA1 Wiadomość Data
Paul Sokolovsky 4238bc9653 uasyncio: Release 2.0. 2018-05-11 14:18:02 +10:00
Paul Sokolovsky 5149a54f91 uasyncio: Update __init__() to take runq_len & waitq_len params. 2018-05-11 14:18:02 +10:00
Paul Sokolovsky ab3198edd7 uasyncio: benchmark/boom_uasyncio.py: More assert output. 2018-05-11 14:18:02 +10:00
Paul Sokolovsky 5925aa60e2 uasyncio: Release 1.4.2. Packaging fix. 2018-02-04 13:44:38 +02:00
Paul Sokolovsky 60de502676 all: setup.py: Switch to sdist_upip. 2018-02-02 20:30:52 +02:00
Paul Sokolovsky f2114d889d uasyncio: Release 1.4.1. 2018-01-23 23:23:19 +02:00
Paul Sokolovsky 147085d0f7 uasyncio: Be sure to create socket with params returned by getaddrinfo(). 2018-01-23 23:22:37 +02:00
Paul Sokolovsky 057b0ba4c4 uasyncio: Release 1.4. 2017-12-15 20:25:35 +02:00
Paul Sokolovsky f6555bae97 uasyncio: On scheduling ready coro, unmark it as I/O-waiting.
Coros which are passed to .add_reader()/.add_writer() are marked as
I/O-bound using .pend_throw(False). Before scheduling it for normal
execution again, we need to unmark it with .pend_throw(None).
2017-12-14 19:14:42 +02:00
Paul Sokolovsky f1fa3a7ff1 uasyncio: Release 1.3. 2017-12-09 18:08:50 +02:00
Paul Sokolovsky 04c0110319 uasyncio: open_connection: Initial hackish SSL support.
It performs handshake in blocking manner, hopes that writes
work without short writes, and hopes that non-blocking read
is implemented properly by ussl module (there're known issues
with axTLS module for example).
2017-12-09 18:07:32 +02:00
Paul Sokolovsky ec7a9a1f20 uasyncio: README: Mention .awrite() and .aclose() methods vs asyncio. 2017-12-02 12:59:33 +02:00
Paul Sokolovsky f704ac5817 uasyncio: StreamReader: Separate "poll socket" vs "I/O socket".
Poll socket is what's passed to uselect.poll(), while I/O socket is what's
used for .read(). This is a workaround of the issue that MicroPython doesn't
support proxying poll functionality for stream wrappers (like SSL, websocket,
etc.)
This issue is tracked as https://github.com/micropython/micropython/issues/3394

It may be that it's more efficient to apply such a workaround on uasyncio
level rather than implementing full solution of uPy side.
2017-11-05 18:01:21 +02:00
Paul Sokolovsky bd828087e1 uasyncio: Release 1.2.4. 2017-11-05 17:52:15 +02:00
Paul Sokolovsky 9c18d6f39b uasyncio: test_http_server_heavy: Close socket with "finally". 2017-11-05 17:46:50 +02:00
Paul Sokolovsky f81285ff4e uasyncio: Auto-unregister poll objects on POLLHUP/POLLERR.
POLLHUP/POLERR may be returned anytime (per POSIX, these flags aren't
even valid in input flags, they just appear in output flags). Subsequent
I/O operation on stream will lead to exception. If an application
doesn't do proper exception handling, the stream won't be closed, and
following calls will return POLLHUP/POLLERR status again (infinitely).
So, proactively unregister such a stream.

This change is questionable, because apps should handle errors properly
and close the stream in such case (or it will be leaked), and closing
will remove the stream from poller too.

But again, if that's not done, it may lead to cascade of adverse effects,
e.g. after eef054d98, benchmark/test_http_server_heavy.py regressed and
started and started to throw utimeq queue overflow exceptions. The story
behind it is: Boom benchmarker does an initial probe request to the app
under test which it apparently doen't handle properly, leading to
EPIPE/ECONNRESET on the side of the test app, the app didn't close the
socket, so each invocation to .wait() resulted in that socket being
returned with POLLHUP again and again. Given that after eef054d98, .wait()
is called on each even loop iteration, that create positive feedback in
the queue leading to it growing to overflow.
2017-11-05 17:12:12 +02:00
Paul Sokolovsky da124acfdb uasyncio: Release 1.2.3, added initial README. 2017-10-30 01:23:19 +02:00
Peter Hinch 65605e3de8 uasyncio: Add test showing I/O scheduling starvation.
If there is a coroutine to run immediately (with wait delay <= 0),
uasyncio.core never calls .wait() method, which is required to
process I/O events (and schedule coroutines waiting for them).

This test demonstrates the problem.
2017-08-20 16:36:15 +03:00
Paul Sokolovsky 7d9eb0716c uasyncio: Release 1.2.2. 2017-06-10 16:11:41 +03:00
Paul Sokolovsky a191626c2e uasyncio: Add awriteiter() method.
Write piecewise content from iterable (usually, a generator).
2017-06-10 16:10:27 +03:00
Paul Sokolovsky e1f75100cf uasyncio: Release 1.2.1. 2017-06-08 02:54:42 +03:00
Paul Sokolovsky a2097be138 uasyncio: Add own set_debug() function.
set_debug() from uasyncio.core doesn't have effect on the main uasyncio
package, so let them both have set_debug() function, and allow to enable
debug logging independently.
2017-06-08 02:51:29 +03:00
Paul Sokolovsky 75e1474ddf uasyncio: awrite: Use 3-arg .write(), accept offset/size too.
Use MicroPython .write() extension of passing offset/size to efficiently
spool buffers larger than socket output buffer. Also, make awrite()
accept these params too.
2017-06-07 03:09:34 +03:00
Paul Sokolovsky 87e30182a1 uasyncio: test-ab-medium.sh: Run ab on http://127.0.0.1 .
On some hosts, http://localhost doesn't work, apparently ab resolve it
via IPv6 or something.
2017-06-06 21:37:55 +03:00
Paul Sokolovsky f5fe55aaef uasyncio: Release 1.2. 2017-06-06 21:27:50 +03:00
Paul Sokolovsky 16afc06b8c uasyncio: Switch to memory-efficient poll.ipoll() method.
As added in MicroPython 1.9.
2017-06-06 21:04:37 +03:00
Paul Sokolovsky e8e531b754 uasyncio: Release 1.1.2. 2017-05-05 11:35:24 +03:00
Paul Sokolovsky 9a72e29564 uasyncio: Consistently use "if DEBUG and __debug__:" stanza.
To make sure this module can work without logging module imported, just
like uasyncio.core was made to.
2017-05-05 11:33:39 +03:00
Paul Sokolovsky 53193ba2e7 uasyncio: benchmark: Modern browsers produce requests more than 256 bytes.
So, not all of the request was read, and a browser would report than
connection was reset.
2017-03-16 01:55:32 +03:00
Paul Sokolovsky a355801fb1 uasyncio: wait: Remove no longer needed "if", artifact of epoll impl. 2017-03-13 00:44:58 +03:00
Paul Sokolovsky 4fc72c6032 uasyncio: Remove "epoll" references from previous Linux-only implementation. 2017-03-12 16:42:02 +03:00
Paul Sokolovsky aba6935892 uasyncio: Release 1.1.1. 2017-02-16 00:04:39 +03:00
Paul Sokolovsky 67445f3334 uasyncio: benchmark: Rename test runners to correspond to underlying tests. 2017-02-15 11:19:10 +03:00
Paul Sokolovsky 6a4973331a uasyncio: benchmark: Set higher queue length for "medium" test.
Following setting the default conservatively low in the module.
Surprisingly, heavy test appears to work with new default length
of 42.
2017-02-15 11:17:02 +03:00
Paul Sokolovsky e3dac1d693 uasyncio: Allow to override queue length, while setting low default.
The default queue length is set to take under 0.5K RAM on 32-bit system.
A queue length can be passed to get_event_loop() to override it. This
change follows similar change in uasyncio.core.
2017-02-15 11:14:53 +03:00
Paul Sokolovsky f6668aae28 uasyncio: Release 1.1. 2017-01-28 01:58:05 +03:00
Paul Sokolovsky 1bf1c74ae5 uasyncio: Use builtin uerrno module. 2017-01-28 01:55:40 +03:00
Paul Sokolovsky 7043ee0702 uasyncio: Implement StreamReader.readexactly().
With a unit test.
2017-01-28 01:04:21 +03:00
Paul Sokolovsky ec7b4b948b uasyncio: StreamReader.readline: Handle partial reads.
Now it will return a complete line regardless if it may take several
partial reads to do that. Test included.
2017-01-27 01:09:19 +03:00
Paul Sokolovsky a8d85e28d0 uasyncio: Fix partial reads in StreamReader.read/readline() methods.
If None (no data, would block) is received, need to wait for more data,
not just read it again immediately.
2017-01-26 22:20:29 +03:00
Paul Sokolovsky 56dd0f94e9 uasyncio: Rename examples as such. 2017-01-04 18:01:05 +03:00
Paul Sokolovsky 3e37bdda56 uasyncio: Move test_call_soon.py to uasyncio.core, as it needs only it.
Also, rename as example.
2017-01-04 18:01:05 +03:00
Daniel Mizyrycki 4bc5ab902b uasyncio: Add echo test 2017-01-01 19:06:54 -08:00
Daniel Mizyrycki 0f5d5cead7 uasyncio: Add minimum esp8266 support 2017-01-01 18:17:17 -08:00
Paul Sokolovsky 6256ad69c0 uasyncio: Release 1.0.1. 2016-12-30 22:32:26 +03:00
Paul Sokolovsky 5403e0f710 uasyncio: Use DEBUG variable as imported from uasyncio.core.
Avoids heap allocation to render disabled debug logging strings.
2016-12-29 11:37:41 +03:00
Paul Sokolovsky f29be360c0 uasyncio: wait: Add workaround against heap alloc on empty iteration.
"for a in ():" unconditionally allocates heap so far, per
https://github.com/micropython/micropython/issues/2716 . So, test for
empty result before iterating over it.
2016-12-28 10:25:31 +03:00
Paul Sokolovsky 23ff6305c3 uasyncio: Release 1.0. 2016-11-13 15:18:30 +03:00
Paul Sokolovsky 67d8e55dea uasyncio: Update for switching to utime.ticks_ms() timesource. 2016-11-13 04:39:52 +03:00
Paul Sokolovsky dfe4dee62a all: setup.py: New releases for gzip 4k conversion. 2016-10-11 06:47:01 +03:00