extmod/modasyncio: Add support for a callback on TaskQueue push.

Allows passing in a callback to `TaskQueue()` that is called when something
is pushed on to the queue.

Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
Damien George
2024-06-19 17:27:31 +10:00
parent e9c898cb33
commit 8ac9c8f392
2 changed files with 20 additions and 1 deletions

View File

@@ -1610,6 +1610,10 @@ typedef double mp_float_t;
#define MICROPY_PY_ASYNCIO (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EXTRA_FEATURES)
#endif
#ifndef MICROPY_PY_ASYNCIO_TASK_QUEUE_PUSH_CALLBACK
#define MICROPY_PY_ASYNCIO_TASK_QUEUE_PUSH_CALLBACK (0)
#endif
#ifndef MICROPY_PY_UCTYPES
#define MICROPY_PY_UCTYPES (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EXTRA_FEATURES)
#endif