Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

aioevents-ng

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aioevents-ng

A simple library for managing events through an asynchronous queue

  • 0.0.9
  • PyPI
  • Socket score

Maintainers
1

========= aioevents

.. image:: https://travis-ci.com/mpyatishev/aioevents.svg?branch=master :target: https://travis-ci.com/mpyatishev/aioevents .. image:: https://codecov.io/gh/mpyatishev/aioevents/branch/master/graph/badge.svg :target: https://codecov.io/gh/mpyatishev/aioevents .. image:: https://img.shields.io/pypi/v/aioevents-ng.svg :target: https://pypi.python.org/pypi/aioevents-ng

A simple library for managing events through an asynchronous queue

Installation

.. code:: bash

pip install aioevents-ng

Usage example

.. code:: python

import asyncio

from dataclasses import dataclass

import aioevents

@dataclass class MyEvent(aioevents.Event): payload: str

@aioevents.manager.register(MyEvent) async def event_hadler(event: aioevents.Event): print(f"recieved: {event}")

async def produce(): async with aioevents.events as events: await events.publish(MyEvent("Hello!"))

async def main(): aioevents.start(asyncio.get_event_loop())

  await produce()

  print('stopping worker')
  aioevents.stop()

  # wait for all coroutines
  await asyncio.sleep(1)

if name == "main": asyncio.run(main())

License

aioevents library is offered under Apache 2 license.

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc