diff --git a/README.md b/README.md index 2dca28b..dc0b408 100644 --- a/README.md +++ b/README.md @@ -19,25 +19,10 @@ like the sync `Client`. Methods are *not* coroutines, they are non-blocking fun `await`. The only exception is accessing messages through `async for`. ### Example -```python -import paho.mqtt.client as mqtt -import trio -from trio_paho_mqtt import AsyncClient +Please see `example.py` for a working example! +(example in README removed because it was not working) -async def handle_messages(client): - async for msg in client.messages(): - print(f"Received msg: {msg}") - -async with trio.open_nursery() as nursery: - sync_client = mqtt.Client() - client = AsyncClient(sync_client, nursery) - client.connect('mqtt.eclipse.org', 1883, 60) - client.subscribe(topic) - client.publish(topic, msg) - - nursery.start_soon(handle_messages, client) -``` ## Related projects - [gmqtt](https://github.com/wialon/gmqtt) - Uses asyncio and callbacks. Isn't compatible with trio. diff --git a/pyproject.toml b/pyproject.toml index 4f795aa..a6cf629 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ name = "trio-paho-mqtt-up1" version = "0.4.0" description = "MQTT support for the Trio async runtime using Paho (update fork)" authors = ["Olivier (fork) ", "bkanuka (original maintainer) "] -license = "Apache2" +license = "Apache-2.0" readme = "README.md" packages = [{include = "trio_paho_mqtt"}]