8000 GitHub - NuCOS/nucosObs: an observer/observable framework basend on python asyncio (>= 3.5)
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

NuCOS/nucosObs

Repository files navigation

nucosObs

nucosObs serves as an observer-observable framework based on asyncio.

Current Version PyPI

Install

pip install nucosObs

Documentation

The project ships a small but handy toolbox to build applications using the observer/observable pattern with asyncio. It contains helper classes for observers, observables and a couple of interfaces (stdin, websockets and aiohttp based websockets) to communicate with running tasks.

Example

import asyncio as aio

from nucosObs import main_loop
from nucosObs.observable import Observable
from nucosObs.observer import Observer


class HelloObserver(Observer):
    async def say(self):
        print("Hello")


A = Observable()
O = HelloObserver("O", A)
aio.ensure_future(A.put({"name": "say"}))
main_loop([])

See the examples directory for more advanced usage.

Licence

MIT License

Platforms

No specific platform dependency. Python 3.5 is minimum.

About

an observer/observable framework basend on python asyncio (>= 3.5)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  
0