Skip to main content

Pubsub system for aio framework

Project description

Pubsub system for the aio asyncio framework

Build status

https://travis-ci.org/phlax/aio.signals.svg?branch=master

Installation

Install with:

pip install aio.signals

Code example

The callback listener takes 2 arguments, the name of the signal, and the argument that was emitted

The listen function is called synchronously, but the callback listener should be a coroutine or future

The emit function is a coroutine

import asyncio
from aio.signals import Signals

@asyncio.coroutine
def listener(signal, message):
    print(message)

signals = Signals()
signals.listen("my-signal", listener)

loop = asyncio.get_event_loop()
loop.run_until_complete(
    signals.emit("my-signal", 'BOOM!'))

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

aio.signals-0.0.3.tar.gz (2.9 kB view details)

Uploaded Source

File details

Details for the file aio.signals-0.0.3.tar.gz.

File metadata

  • Download URL: aio.signals-0.0.3.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for aio.signals-0.0.3.tar.gz
Algorithm Hash digest
SHA256 1ba795adfe587e6a055660128f29f8e8d825ed84fec675f0b2372f759fe44837
MD5 b8c641ab8aebd81efc0d46dba8096ee0
BLAKE2b-256 eb8131c76668b6ec82df5bfd9d2cff97ab376894e7ae3eabac135cadf6f2c78e

See more details on using hashes here.

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