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

aonsq

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aonsq

nsq client library

  • 0.1.9
  • PyPI
  • Socket score

Maintainers
1

aonsq

nsq client

Example

import orjson
import asyncio
from datetime import datetime, timezone
from loguru import logger

from aonsq import NSQMessage, NSQ

async def msg_handler(msg: NSQMessage) -> bool:
    logger.debug(f"msg: {msg.id}")
    return True


async def test():
    mq = NSQ(host="127.0.0.1", port=4071)
    await mq.connect()
    await mq.sub("demo", "test", msg_handler)

    while True:
        for j in range(1000):
            await mq.pub("demo", orjson.dumps({"id": j, "ts_created": datetime.now(timezone.utc)}))

        await asyncio.sleep(1)

try:
    asyncio.get_event_loop().run_until_complete(test())
except KeyboardInterrupt:
    pass

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