Releases: nexconnectio/pynnex
Release v1.1.5
This release focuses on improving FastAPI & SocketIO examples and enhancing code consistency.
What's Changed
FastAPI & SocketIO Examples
- Added new QR code generation example with real-time updates
- Added interactive stock monitoring web application example
- Enhanced WebSocket communication patterns
Code Improvements
- Enhanced error handling in WebSocket communication
- Improved real-time data processing patterns
- Updated example architecture for better scalability
Documentation
- Added documentation for new examples
- Improved setup instructions for new examples
Required Dependencies
New examples require additional packages:
Release v1.1.3
What's changed
Worker Pattern Improvements
- Improve task cancellation handling with simplified result processing
Code Quality
- Clarify worker thread function naming for better readability
- Remove redundant cancelled flag
- Move task result handling into try block for more robust error handling
Release v1.1.1
This release improves the worker pattern implementation and enhances example code usability.
What's Changed
Worker Pattern Improvements
- Added state machine (CREATED → STARTING → STARTED → STOPPING → STOPPED)
- Added thread-safe task queue with pre-loop buffering
- Replaced
run()
method withstarted
signal listener pattern - Enhanced worker lifecycle management and cleanup
- Added detailed debug logging for worker operations
Example Code Enhancements
- Updated examples to use new worker pattern
- Improved error handling in UI examples
- Fixed import paths across example files
- Enhanced user interaction and feedback
- Added more descriptive input prompts
Documentation
- Updated API documentation for worker pattern
- Added detailed examples for worker state management
- Improved code comments and docstrings
Migration Guide
While the old run() method is still supported, we recommend using the new signal-based pattern in new code:
@with_worker
class Worker:
def __init__(self):
self.started.connect(self.on_started)
self.stopped.connect(self.on_stopped)
@listener
async def on_started(self, *args, **kwargs):
# Initialize and start processing
self._task = asyncio.create_task(self.process())
@listener
async def on_stopped(self):
# Cleanup resources
if self._task:
self._task.cancel()
Backward Compatibility
All existing worker code continues to work as-is. The new state machine and task queue are automatically integrated with existing worker classes.
Release v1.1.0
This release introduces more intuitive terminology by renaming signal/slot to emitter/listener throughout the API, while maintaining full backward compatibility.
What's Changed
- Renamed decorators with new aliases:
@signal
→@emitter
@slot
→@listener
@with_signals
→@with_emitters
- Updated documentation and examples to use new terminology
- Updated logging namespaces from signal/slot to emitter/listener
Backward Compatibility
All existing code continues to work as-is. The old decorators (@signal
, @slot
, @with_signals
) are kept as aliases and will remain supported.
Migration
While not required, we recommend using the new terminology in new code:
from pynnex import emitter, listener
class Example:
@emitter
def on_change(self): ...
@listener
def handle_change(self): ...
Release v1.0.4
Core improvements focused on logging clarity and weak reference management:
Logging
- Unified log message format across all components
- Removed redundant prefixes and memory addresses
- Added consistent structure to trace logs
- Improved readability of signal/slot connection logs
Weak References
- Enhanced weak reference cleanup in signal connections
- Improved thread safety in weak reference handling
- Better memory management for one-shot connections
Documentation
- Simplified core docstrings for better readability
- Moved detailed examples to documentation
- Maintained consistent format across API docs
Release v1.0.1
PynneX 1.0.1
A pure-Python library for event-driven concurrency with signals/slots pattern, designed for async and multi-threaded environments.
Key Features
- Pure Python: No external dependencies needed
- Async/Await Friendly: Supports both synchronous and asynchronous slots
- Thread-Safe: Automatic signal/slot management across thread boundaries
- Flexible Connection Types: Direct or queued connections based on thread context
- Worker Thread Pattern:
@nx_with_worker
for dedicated thread & event loop - Thread-Safe Properties:
@nx_property
for signal emission on value changes - Weak Reference Support: Optional weak connections for automatic cleanup
Quick Start
Requires Python 3.10+
Example
from pynnex import with_signals, signal, slot
@with_signals
class Counter:
def __init__(self):
self.count = 0
@signal
def count_changed(self):
pass
def increment(self):
self.count += 1
self.count_changed.emit(self.count)
@with_signals
class Display:
@slot
async def on_count_changed(self, value):
print(f"Count is now: {value}")
# Connect and use
counter = Counter()
display = Display()
counter.count_changed.connect(display, display.on_count_changed)
counter.increment() # Will print: "Count is now: 1"
Documentation
For detailed documentation, examples, and API reference, please visit our GitHub repository.