News for hackers. Stuff that matters.
Re:Show HN: Reactive Signals for Python – inspired by Angula... by buibuibui on Thursday January 30, 2025 @03:32PM (#42881884)
I’ve seen how the frontend world solved state management with reactivity, but I couldn’t find anything similar for backend development in Python. So I built reaktiv to bring the same automatic dependency tracking and state propagation to async Python code.

In frontend frameworks, Signals eliminate the need for manual subscriptions and event handling, making state updates more efficient. I wanted the same benefits for backend systems—where changes to shared state should propagate automatically, without polling, callbacks, or race conditions.

For example, if a config value or cached result updates, anything depending on it should react immediately. With Signals, you don’t have to manually notify consumers or keep track of what depends on what—it just works.

About `asyncio.sleep(0)`: it’s just there to keep the example concise. Normally, you’d be inside an async function that naturally yields control, like handling a request or waiting for I/O.

Re:Show HN: Reactive Signals for Python – inspired by Angula... by debuggerpk on Thursday January 30, 2025 @09:44PM (#42884275)
backend has cache and database for state management. for more complex cases, better use temporal, dbos etc.
Re:Show HN: Reactive Signals for Python – inspired by Angula... by baq on Friday January 31, 2025 @01:57AM (#42885249)
How many caches and how many databases? I’ve got more than I’d like of either and making sure the right things are happening at the right time is not as trivial as you make it sound.
Re:Show HN: Reactive Signals for Python – inspired by Angula... by MortyWaves on Friday January 31, 2025 @02:14AM (#42885337)
Re:Show HN: Reactive Signals for Python – inspired by Angula... by buibuibui on Saturday February 01, 2025 @07:48AM (#42897928)
As an Angular/RxJS developer, RxPY was the first library I tried in my projects (about two years ago, I think). However, it had too many footguns that I didn’t encounter with RxJS. Because of that, I opted for simple asyncio Queues instead. Now that Angular is transitioning from RxJS to Signals, I was curious if something similar exists in the Python ecosystem.