pybeehive

https://img.shields.io/pypi/v/pybeehive.svg https://img.shields.io/travis/sentrip/pybeehive.svg Documentation Status https://codecov.io/gh/sentrip/pybeehive/branch/master/graph/badge.svg Updates

A lightweight, event-driven concurrency library with bees!

Features

  • One interface for writing concurrent code, both sync and async

Basic Usage

from pybeehive import Hive
import time
hive = Hive()

@hive.streamer
def stream():
    while True:
        time.sleep(1)
        yield 'hello world!'

@hive.listener
def on_event(event):
    print(event)

if __name__ == '__main__':
    hive.run()
$ python hello.py
Event(created_at=1525400000, data="hello world!")
Event(created_at=1525400001, data="hello world!")
Event(created_at=1525400002, data="hello world!")
...