Skip to content

Strange behaviour (or me not properly understanding asyncio and aiozmq) - Code only sends when publish more than once #188

@marek-j

Description

@marek-j

The publish is only send (or received) when max > 1, but then it only sends one less time than asked to run.

 async def go():
     tb = await rpc.connect_pubsub(connect="tcp://localhost:5501")
     max = 2
     idx = 0
     while True:
        print("sleeping ")
        if idx < max:
            tb.publish("botupdates").message("Test")           
        await asyncio.sleep(4)
        idx = idx +1 
         
 
 asyncio.run(go())

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions