@@ -101,9 +101,7 @@ client.on('topic1.*', handle_message)
101101Publish messages to a topic:
102102
103103``` python
104- await client.publish(' topic1' , ' Hello, world!' , {
105- ' messageType' : ' text-message' ,
106- })
104+ await client.publish(' topic1' , ' Hello, world!' , message_type = ' text-message' )
107105```
108106
109107### Responding to Incoming Messages
@@ -130,9 +128,7 @@ client.on('topic1.text-message', handle_message)
130128Wait for the Realtime Gateway acknowledgement after publishing a message:
131129
132130``` python
133- waiter = await client.publish(' secure/peer-to-peer1' , ' Hi' , {
134- ' messageType' : ' greeting' ,
135- })
131+ waiter = await client.publish(' secure/peer-to-peer1' , ' Hi' , message_type = ' text-message' )
136132await waiter.wait_for_ack()
137133```
138134
@@ -141,9 +137,7 @@ Wait for the Realtime Gateway acknowledgement after sending a message:
141137``` python
142138waiter = await client.send({
143139 # Message payload
144- }, {
145- ' messageType' : ' create' ,
146- })
140+ }, message_type = ' create' )
147141await waiter.wait_for_ack()
148142```
149143
@@ -152,9 +146,7 @@ Wait for a reply with a timeout:
152146``` python
153147waiter = await client.send({
154148 # Message payload
155- }, {
156- ' messageType' : ' create' ,
157- })
149+ }, message_type = ' create' )
158150await waiter.wait_for_reply(timeout = 5 ) # Wait for up to 5 seconds
159151```
160152
@@ -217,15 +209,15 @@ Creates a new `RealtimeClient` instance.
217209 await client.unsubscribe_remote_topic(topic)
218210 ```
219211
220- - ** ` publish(topic, payload, options =None) ` ** : Publishes a message to a topic.
212+ - ** ` publish(topic, payload, message_type="broadcast", compress=False, message_id =None) ` ** : Publishes a message to a topic.
221213
222214 ``` python
223- waiter = await client.publish(topic, payload, options )
215+ waiter = await client.publish(topic, payload)
224216 ```
225217
226218 Returns a ` WaitFor ` instance to wait for acknowledgements or replies.
227219
228- - ** ` send(payload, options =None) ` ** : Sends a message to the server.
220+ - ** ` send(payload, compress=False, message_id =None) ` ** : Sends a message to the server.
229221
230222 ``` python
231223 waiter = await client.send(payload, options)
0 commit comments