# -*- coding: utf-8 -*-
import asyncio
from rstream import Producer

STREAM = 'demo-stream'
USER   = 'user'
PWD    = 'J70e6K7BRrxrU1dO'
HOST   = 'rabbitmq.rabbitmq.svc.cluster.local'

async def main():
    producer = Producer(host=HOST, port=5552, username=USER, password=PWD)
    async with producer:
        await producer.create_stream(STREAM)
        for i in range(100_000):
            await producer.send(STREAM, f"msg-{i}".encode())
        print(" [x] Sent 100k messages to stream")

if __name__ == '__main__':
    asyncio.run(main())