You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Are you looking for a signal/slot pattern in Python without Qt dependencies? TSignal provides a lightweight, thread-safe, and asyncio-compatible implementation that gives you all the power of Qt's signal/slot pattern without the heavyweight dependencies. Perfect for:
3
+
TSignal is a lightweight, pure-Python signal/slot library that provides thread-safe, asyncio-compatible event handling inspired by the Qt signal/slot pattern—but without the heavyweight Qt dependencies. It enables clean decoupling of components, seamless thread-to-thread communication, and flexible asynchronous/synchronous slot handling.
4
4
5
-
- Async applications needing event handling
6
-
- Thread communication in Python applications
7
-
- Event-driven architectures
8
-
- Decoupled component communication
5
+
## Key Features
6
+
7
+
-**Pure Python**: No Qt or external GUI frameworks needed.
8
+
-**Async/Await Friendly**: Slots can be synchronous or asynchronous, and integrate seamlessly with asyncio.
9
+
-**Thread-Safe**: Signal emissions and slot executions are automatically managed for thread safety.
10
+
-**Flexible Connection Types**: Direct or queued connections, automatically chosen based on the caller and callee threads.
11
+
-**Worker Thread Pattern**: Simplify background task execution with a built-in worker pattern that provides an event loop and task queue in a dedicated thread.
12
+
-**Familiar Decorators**: Inspired by Qt’s pattern, `@t_with_signals`, `@t_signal`, and `@t_slot` let you define signals and slots declaratively.
9
13
10
14
## Why TSignal?
11
-
- 🚀 Pure Python implementation - no Qt or external dependencies required
12
-
- ⚡ Async/await support out of the box
13
-
- 🔒 Thread-safe signal emission and slot execution
14
-
- 🎯 Simple, decorator-based API similar to Qt
15
-
- 🔄 Automatic thread handling for cross-thread signals
15
+
16
+
Modern Python applications often rely on asynchronous operations and multi-threading. Traditional event frameworks either require large external dependencies or lack seamless async/thread support. TSignal provides:
17
+
18
+
- A minimal, dependency-free solution for event-driven architectures.
19
+
- Smooth integration with asyncio for modern async Python code.
20
+
- Automatic thread-affinity handling so cross-thread signals "just work."
21
+
- Decorator-based API that’s intuitive and maintainable.
0 commit comments