Wykres commitów

82 Commity (0feab3397eb25dd85bc1d5f37536b6f16c21e435)

Autor SHA1 Wiadomość Data
Paul Sokolovsky 97be3343fa uasyncio.core: Release 2.0. 2018-05-11 14:18:02 +10:00
Paul Sokolovsky 7e8a3cfe45 uasyncio.core: test_full_wait: Update for runq/waitq refactor. 2018-05-11 14:18:02 +10:00
Paul Sokolovsky 4c63ecf5a6 uasyncio.core: Switch to separate run and wait queues.
Instead of using single priority queue for all tasks, split into using
"run queue", which represents tasks not waiting until specific time,
which should be run on every (well, next) loop iteration, and wait queue,
still a priority queue. Run queue is a simple FIFO, implemented by
ucollections.deque, recently introduced in pfalcon/micropython. Thus,
there's minimal storage overhead and intrinsic scheduling fairness.
Generally, run queue should hold both a callback/coro and its arguments,
but as we don't feed any send args into coros still, it's optimized to
hold just 1 items for coros, while 2 for callbacks.

Introducing run queue will also allow to get rid of tie-breaking counter
in utimeq implementation, which was introduced to enforce fair scheduling.
It's no longer needed, as all tasks which should be run at given time
are batch-removed from wait queue and batch-inserted into run queue. So,
they may be executed not in the order scheduled (due to non-stable order
of heap), but the whole batch will be executed "atomically", and any new
schedulings from will be processed no earlier than next loop iteration.
2018-05-11 14:18:02 +10:00
Paul Sokolovsky 72a90a0c93 uasyncio.core: test_full_wait.py: Make easier to debug. 2018-02-05 12:36:13 +02:00
Paul Sokolovsky 85c82e7467 uasyncio.core: example_call_soon.py: Add logging setup. 2018-02-05 00:21:39 +02:00
Paul Sokolovsky bc14f2f6eb uasyncio.core: test_fair_schedule.py: More checks and iterations. 2018-02-05 00:19:34 +02:00
Paul Sokolovsky 04f8f3db0c uasyncio.core: Release 1.7.2. Packaging fix. 2018-02-04 13:43:07 +02:00
Paul Sokolovsky 60de502676 all: setup.py: Switch to sdist_upip. 2018-02-02 20:30:52 +02:00
Paul Sokolovsky 2ff5940d92 all: setup.py: Consistently update author and maintainer fields. 2018-02-02 20:25:27 +02:00
Paul Sokolovsky 9ff3beabd1 uasyncio.core: Release 1.7.1. 2018-01-07 10:44:13 +02:00
Paul Sokolovsky 06a2abae56 uasyncio.core: Add test for cancel(coro) function. 2018-01-07 10:43:15 +02:00
Paul Sokolovsky 17a432c1a3 uasyncio.core: Add cancel(coro) function.
This also adds CancelledError exception and makes TimeoutError be a
subclass of it. As well as adds default exception handler for it in
the eventloop (which just skips re-adding this coro to the scheduling
queue, as expected).
2018-01-07 10:41:51 +02:00
Paul Sokolovsky fede052d48 uasyncio.core: Release 1.7. 2017-12-15 20:24:40 +02:00
Paul Sokolovsky f6c00613db uasyncio.core: Add test for wait_for() call. 2017-12-14 19:38:49 +02:00
Paul Sokolovsky 203cc489c6 uasyncio.core: wait_for: Add support for cancelling I/O-bound coros.
Coros which removed from normal scheduling queue (and possibly put into
another queue, like I/O queue here) are marked with .pend_throw(False).
If wait_for() cancels such a coro, it is explicitly scheduled for execution,
so they actually could process pending exception (coro's exception handler
should take care of removing it from another queue and related clean up).
2017-12-14 19:09:02 +02:00
Paul Sokolovsky a7f8eaa6ed uasyncio.core: Release 1.6. 2017-12-09 18:05:47 +02:00
Paul Sokolovsky d19253a222 uasyncio.core: Implement wait_for() function for CPU-bound coroutines.
This requires a new .pend_throw() generator method on MicroPython side.
Timing out of I/O-bound coroutines doesn't work yet.
2017-12-03 02:09:10 +02:00
Paul Sokolovsky afa6192501 uasyncio.core: Store currently executed task as an attribute of event loop.
Currently executed task is a top-level coroutine scheduled in the event
loop (note that sub-coroutines aren't scheduled in the event loop and
are executed implicitly by yield from/await, driven by top-level coro).
2017-12-03 00:22:17 +02:00
Paul Sokolovsky e046338ea2 uasyncio.core: Release 1.5.1, updated description. 2017-10-28 22:52:15 +03:00
Paul Sokolovsky a314da83f1 uasyncio.core: logging is not longer hard dependency, remove it.
If user is going to enable logging in particular app, they should depend
on it themselves.
2017-10-28 02:17:24 +03:00
Paul Sokolovsky 62fbfa9965 uasyncio.core: Add yield call to remove coro from scheduling.
yield False won't reschedule current coroutine to be run again. This is
useful when coro is put on some waiting queue (and is similar to what
yield IORead/yield IOWrite do).
2017-10-28 02:14:02 +03:00
Paul Sokolovsky ec67618df1 uasyncio.core: Release 1.5. 2017-09-01 15:14:32 +03:00
Paul Sokolovsky 79f13b6e4a uasyncio.core/test_full_wait: Update for .wait() called on each loop iter.
This fixes this mock test after the recent change to make I/O scheduling
fair.
2017-08-20 17:06:07 +03:00
Paul Sokolovsky eef054d98a uasyncio.core: Make I/O scheduling fair wrt to computational scheduling.
If there is a coroutine to run immediately (with wait delay <= 0),
uasyncio.core never called .wait() method, which is required to
process I/O events (and schedule coroutines waiting for them). So
now, call .wait(0) even if there's a coroutine to run immediately.
2017-08-20 17:04:31 +03:00
Paul Sokolovsky a4b75ab2bf uasyncio.core: Release 1.4.2. 2017-06-08 02:48:45 +03:00
Paul Sokolovsky b9540e4afe uasyncio.core: Use "uasyncio.core" logger. 2017-06-08 02:48:04 +03:00
Paul Sokolovsky 21d60a8b5f uasyncio.core: Release 1.4.1. 2017-05-23 01:27:33 +03:00
Paul Sokolovsky e13e139f51 uasyncio.core: Don't feed old send arguments into next coro invocation.
As all current syscalls don't return any value, there's nothing to feed
actually.
2017-05-23 01:26:08 +03:00
Paul Sokolovsky 191de78b16 uasyncio.core: Release 1.4. 2017-05-22 13:58:51 +03:00
Paul Sokolovsky c01004d71f uasyncio.core: Add test for callback args to call_soon(). 2017-05-22 13:57:57 +03:00
Paul Sokolovsky 241e7b1a3b uasyncio.core: Add stop() method for loop.
To allow to stop loop from a callback function.
2017-05-22 13:49:27 +03:00
Paul Sokolovsky bf327f755a uasyncio.core: Fix args handling for call_soon/call_later/call_later_ms. 2017-05-22 13:21:54 +03:00
Paul Sokolovsky 22cd93fb1a uasyncio.core: Release 1.3. 2017-05-16 23:01:03 +03:00
Paul Sokolovsky 9b5cbcdfce uasyncio.core: test_full_wait: Update for call_later_ms(). 2017-05-16 21:54:21 +03:00
Paul Sokolovsky 4fa29d867a uasyncio.core: Remove call_at() which takes absolute second time.
uasyncio uses different timebase than CPython's asyncio, so absolute
time scheduling compatible with it is impossible. Instead, there's
call_at_() which schedules using modular millisecond time.
2017-05-16 21:53:29 +03:00
Paul Sokolovsky ad73ee3043 uasyncio.core: Use finalized name for call_later_ms(). 2017-05-16 21:53:29 +03:00
Paul Sokolovsky 61392cb641 uasyncio.core: Remove unused Sleep syscall.
It's unused since since sleep() was switched to yield an integer for
delay.
2017-05-16 21:45:13 +03:00
Paul Sokolovsky 3ef991c115 uasyncio.core: Remove legacy commented code for add_reader/add_writer. 2017-05-14 16:38:32 +03:00
Paul Sokolovsky 36744578e2 uasyncio.core: Release 1.2.1. 2017-05-01 16:10:51 +03:00
Paul Sokolovsky aea501add6 uasyncio.core: Import utime unconditionally, uasyncio depends on MicroPython. 2017-05-01 16:09:34 +03:00
Paul Sokolovsky b2f69eb23b uasyncio.core: Add set_debug() method, don't import logging if not called. 2017-05-01 16:04:28 +03:00
Paul Sokolovsky 5cf6600e5e uasyncio.core: Release 1.2. 2017-04-20 21:32:07 +03:00
Paul Sokolovsky bb3057ffed uasyncio.core: Fix scheduling in the presense of I/O completion callbacks.
wait() may finish prematurely due to I/O completion, and schedule new,
earlier than before tasks to run. So, after call to wait(), we need to
check current time and time of head task, and continue to wait if needed.
Recently introduced provisional utimeq.peektime() is used to optimize
querying time of a head task.
2017-04-08 01:34:57 +03:00
Paul Sokolovsky aa9bbe839e uasyncio.core: Add test for full wait for a time-scheduled coro.
Specifically, that a coroutine scheduled to run at some time (after some
delay) waits requested time before it's run and not run prematurely in
case an I/O completion happens before it.
2017-03-12 16:02:06 +03:00
Paul Sokolovsky 48ead94116 uasyncio.core: Add test for fair scheduling. 2017-03-06 12:16:34 +01:00
Paul Sokolovsky 853535802f uasyncio.core: Release 1.1.1. 2017-02-15 23:49:39 +03:00
Paul Sokolovsky 55b4161512 uasyncio.core: Set lower default queue len and allow to override it.
The default is set to be under 0.5K on 32-bit system. A queue length
can be passed to get_event_loop() to override it.
2017-02-15 03:27:59 +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 0f5d5cead7 uasyncio: Add minimum esp8266 support 2017-01-01 18:17:17 -08:00
Paul Sokolovsky f7c5fe1aea uasyncio.core: Release 1.1. 2016-12-30 22:29:19 +03:00