Skip to content

Commit

Permalink
Documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
eerimoq committed May 8, 2019
1 parent 7029f8c commit fbca514
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ An example connecting to an MQTT broker and publishing the message
client = mqttools.Client('broker.hivemq.com', 1883)
await client.start()
await client.publish('/test/mqttools/foo', b'bar')
client.publish('/test/mqttools/foo', b'bar')
await client.stop()
asyncio.run(publisher())
Expand Down
14 changes: 8 additions & 6 deletions mqttools/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -717,8 +717,8 @@ class Client(object):
`host` and `port` are the host and port of the broker.
`client_id` is the client id string. If ``None``, it is created on
the form ``mqttools-<UUID[0..14]>``.
`client_id` is the client id string. If ``None``, a random client
id is generated on the form ``mqttools-<UUID[0..14]>``.
`will_topic`, `will_message` and `will_qos` are used to ask the
broker to send a will when the session ends.
Expand All @@ -735,9 +735,10 @@ class Client(object):
client is willing to assign on request from the broker.
`session_expiry_interval` is the session expiry time in
seconds. Give as 0 to remove the session when the connection ends.
seconds. Give as 0 to remove the session in the broker when the
connection ends.
`kwargs` are passed to `asyncio.open_connection()`.
`kwargs` are passed to ``asyncio.open_connection()``.
Create a client with default configuration:
Expand All @@ -755,6 +756,7 @@ class Client(object):
response_timeout=30',
topic_aliases=['/my/topic']',
topic_alias_maximum=100,
session_expiry_interval=1800,
ssl=True)
"""
Expand Down Expand Up @@ -834,8 +836,8 @@ def client_id(self):

@property
def messages(self):
"""An asyncio.Queue of received messages from the broker. Each message
is a topic-message tuple.
"""An ``asyncio.Queue`` of received messages from the broker. Each
message is a topic-message tuple.
>>> await client.messages.get()
('/my/topic', b'my-message')
Expand Down

0 comments on commit fbca514

Please sign in to comment.