Nigeria No1. Music site And Complete Entertainment portal for Music Promotion WhatsApp:- +2349077287056
Saturday, 20 December 2025
Show HN: Сulsans – Thread-safe async-aware queue for Python https://bit.ly/4p6E1WH
Show HN: Сulsans – Thread-safe async-aware queue for Python In my previous post [0], I described how I came to create aiologic. Here, I want to do the same for a derivative library - Сulsans. In October 2024, I started thinking about how to present aiologic queues. Andrew Svetlov's Janus library [1] had been around for quite some time and was much more popular, so I knew that comparisons with it would be inevitable. However, Janus seemed to be in a suspended state: there had been no major changes for three years, and almost all commits during that period were made by Dependabot. So I asked a relevant question [2]. During the discussion, I pointed out Janus' performance issues and stated that they could be solved by implementing queues on top of my primitives. But since Janus is a mature library, such a radical change could not be accepted. Therefore, as proof of concept, I implemented a new library - Culsans. That is how its story began. Over time, both libraries underwent changes. Janus received significant performance improvements in 1.2.0, not least due to my PRs [3]. In 2.0.0, contrary to the above, backward compatibility was broken as a result of the implementation of shutdown methods. And Culsans became an independent library with its own features (which neither aiologic nor Janus have). So, what is Culsans? It is a library that provides a way to communicate within a single process between different threads, different tasks (including from different event loops; asyncio, Curio, Trio, AnyIO - whatever you want), and even different greenlets (eventlet/gevent), all in a single instance. Its queues are fully compatible with the standard queues via Janus-like interfaces (as well as with Janus itself) and provide additional features such as dynamic maxsize. In short, I invite you to try out my library and see for yourself. [0] https://bit.ly/4qk6k4S [1] https://bit.ly/4p53pvQ [2] https://bit.ly/44AvCDB [3] https://bit.ly/4p1Pirf https://bit.ly/4pWtsa8 December 20, 2025 at 09:25PM
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment