Changelog¶
All notable changes to FlpIt are documented here. The format follows Keep a Changelog.
[0.4.1] - 2026-11-22¶
Added¶
Task.when_each(.NETTask.WhenEach) yields tasks as they complete.Task.collectstays as an alias.- The query operators
when_each(),when_all()andwhen_any()onFlpItandFlpList, so a query of tasks can end in the wait.when_any()is thefirst()of a query of tasks. .NET has these only as staticTaskmethods, not as extension methods. - The query operators
select_await()andwhere_await()onAsyncFlpIt,FlpItandFlpList(.NETSelectAwait/WhereAwait). The callback may return any awaitable, such as aTask, and is awaited one element at a time.select_await()without an argument awaits the elements themselves, for example afterwhen_each().
Documentation¶
- New page on mixing sync and async functions: start in an
async def, put@taskon a blocking function to await it, and call async code from sync code withtwait >>. It includes a blocking-library example. - The task overview covers the new query operators.
[0.4.0] - 2026-11-22¶
Added¶
AsyncFlpIt: theIAsyncEnumerable<T>counterpart toFlpIt, modelled on .NET 10System.Linq.AsyncEnumerable. It supports lazyasync forpipelines, most operators that exist onFlpIt, terminal operators that return aTask, sync or async callbacks (async def f(item, token)), and cancellation throughwith_cancellation(token)ortoken=. Bridges:flp.ait(),FlpIt.to_async_enumerable(),FlpList.to_async_enumerable().@async_flpit(async generator function toAsyncFlpIt, token injection) and@await_using(close streams a coroutine iterated). Abandoned async generators are now closed on the pool, so theirfinallyblocks run.- Task runtime:
Task.wait,wait_all,wait_any(timeout and token),Task.continue_withwithTaskContinuationOptions,TaskCreationOptions.LONG_RUNNING,Task.completed_task,Task.creation_options.Task.collectreturns anAsyncFlpIt;when_all,when_anyandcollectaccept typed collections. flpit.threading:SemaphoreSlim,ManualResetEvent,ThreadLocal,AsyncLocal,WaitHandle.flpit.channels:Channel[T], andflpit.concurrent: concurrent collections, both with migrated .NET tests.- JSON: a type registry (
register_type,register_collection,unregister_type), a pure-Python backend on the stdlibjsonmodule, andset_backend()/FLPIT_JSON_BACKENDto choose a backend.FlpList[T]andwheneverdate/time types are registered by default. - Documentation site with guides, semantics, concurrency and "Explore .NET" pages. Its examples run in CI.
Changed¶
- Tasks run on a .NET-style worker pool instead of a scheduler thread. Task start and await are about 10x cheaper, and work runs in parallel on free-threaded builds. Workers are daemon threads.
Task.result()inside a task now blocks like .NET (and runs unstarted tasks inline) instead of raising.- CSV no longer goes through the JSON machinery. Rows are converted by a converter generated per model and header, and results are real dataclass instances. Loading 300k rows is about 15% faster. Errors name the line and column.
CsvColonly names CSV columns and no longer renames JSON properties.JPropstill applies to CSV when there is noCsvCol.flpit.jsonis now a package. Decoding registered collections on themsgspecbackend is up to 3x faster.msgspecis optional:import flpitno longer loads JSON support, and it is used automatically when installed (on CPython).- Timeouts and deadlines use
time.perf_counter(). On Windows with Python 3.12,time.monotonic()has about 15.6 ms resolution, so short waits could return early.
Deprecated¶
max_pending_backgroundis ignored. The work queue is unbounded.
Fixed¶
sum()andaverage()onDecimalraisedOverflowErrorfor ordinary rounding. They now round silently, as in .NET, and still raise on real overflow.- The task runtime kept never-completed tasks and their awaiters alive for the life of the process.
- Cancelling
Task.delayno longer runs continuations insidecancel(). - Unknown
TaskCreationOptionsbits are rejected (~on anIntFlagignored them).
[0.3.4] - 2026-11-17¶
See the release on GitHub.