Closed Daddelhai closed 3 years ago
Works now like
async with Subscriber(
"example", "amqp://admin:admin@localhost", metrics=["dummy.source"]
) as subscription:
await asyncio.sleep(10)
counter = 0
async with subscription.drain() as drain:
async for metric, time, value in drain:
print(str(counter) + " " + str(time) + " " + str(value))
counter += 1
print("done: " + str(counter) + " data points received")
How do you like it?
Two general comments:
pre-commit
to detect issues with your changes locally, before pushing them. I am not sure what your setup looks like, but I usually just install it in my per-project venv (pip install pre-commit
) and then set up the git
-hooks (pre-commit install
). Then, pre-commit
will run before committing and hopefully detect some issues that slipped through.
Fixes #12
Implements Drain and Subscriber