Skip to main content

Easy data transfer between classes.

Project description

fastwire

Fastwire is a simple package to facilitate communication between objects. It provides similar functionality to Blinker, but uses some newer Python features. It uses an Inversion-of-Control and Dependency injection to help keep code simple.

Basic usage

It's recommended to use the decorator to connect signals, like this.

import fastwire

sc = fastwire.SignalContainer()
signal = sc.signal()

class A():
	@fastwire.connect_to(signal)
	def connected(self, a):
		print(a)

a = A()		
signal.emit(a=5.7) # Prints 5.7

Alternatively, connect manually:

import fastwire

sc = fastwire.SignalContainer()
signal = sc.signal()

class B():
	def connected(self, a):
		print(a)

a = B()
signal.connect(a.connected)	
signal.emit(a=5.7) # Prints 5.7

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fastwire-0.1.1.tar.gz (3.8 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page