Skip to content

Releases: nexconnectio/pynnex

Release v1.0.1

02 Jan 06:21
Compare
Choose a tag to compare

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.