New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

aiosubpub

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aiosubpub

Aio sub pub package.

  • 2.0.0
  • PyPI
  • Socket score

Maintainers
1

Code style: black CI codecov

AioSubPub

Async pub sub implementation.

Inspired by someone else whose name I cannot find anymore. If you see your code (I did some improvements on it I think) please let me know and I am happy to give you credit.

Installation

pip install aiosubpub

Usage

import aiosubpub
import asyncio
loop=asyncio.get_event_loop()

# create a channel
a_channel = aiosubpub.Channel()

# subscribe to the channel using a callback.
def call_back(data):
    print(data)

subscription = loop.create_task(a_channel.subscribe(call_back))

# Publish a message.
a_channel.publish("a message")

subscription.un_subscribe()


# Without callback:

subscription = a_channel.get_subscription()

async def _custom_subscriber():
    with subscription as sub:
        result = await sub.get()
        print(result)

a_channel.publish("a message")

result = await _custom_subscriber()

changelog

1.0.10

  • Add get_latest to the channel.

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