-
Notifications
You must be signed in to change notification settings - Fork 421
Closed
Labels
guidanceQuestion that needs advice or information.Question that needs advice or information.
Description
Dear Experts,
I have a scenario like this:
1 . connect
2 . publish 10 packet asynchronously
3. disconnect
the signature of publishAsync is publishAsync(topic, payload, QoS, ackCallback=None) link
how can I wrap this function to a async function?
I want to have something like this:
async def publish:
publishAsync(arg,cb) # I don't know how should I wait for this, using await does not work
pass
tasks = [publish for i in range(10)]
connect()
loop.run(tasks) # run all in parallel and wait until get their pubAck
disconnect()
I appreciate in advance
ps : I know that maybe it can be implemented in SDK2 but I need to use SDK1
Metadata
Metadata
Assignees
Labels
guidanceQuestion that needs advice or information.Question that needs advice or information.