mirror of
https://github.com/OMGeeky/flucto-heisskleber.git
synced 2025-12-28 23:36:17 +01:00
* WIP: Added async file reader. * Async resampling and synchronization refactored. * Add async mqtt publisher. Remove queue from joint. * Add async zmq publisher and subscriber. * Modify integration tests for streaming. * Name refactoring resampler. * Added async source/sink to factory. * Refactor joint and add integration tests. * Add termcolor dev dependency * Add conosole source and sink * Add cli interface for different protocols * Removed files unfit for merge. * Fix review requests. * Restore use of $MSB_CONFIG_DIR for now. It seems that the default behaviour is not looking for .config/heisskleber * Remove version test, causing unnecessary failures.
18 lines
379 B
Python
18 lines
379 B
Python
import asyncio
|
|
|
|
from heisskleber.mqtt import AsyncMqttSubscriber, MqttConf
|
|
|
|
|
|
async def main():
|
|
config = MqttConf(broker="localhost", port=1883, user="", password="")
|
|
|
|
sub = AsyncMqttSubscriber(config, topic="#")
|
|
|
|
while True:
|
|
topic, data = await sub.receive()
|
|
print(f"topic: {topic}, data: {data}")
|
|
|
|
|
|
if __name__ == "__main__":
|
|
asyncio.run(main())
|