Skip to content

Gracefully terminating client message consumer #13

@aleksarias

Description

@aleksarias

I've noticed when I KeyboardInterrupt I can't get the client to gracefully exit when using this setup:

await client.open()

# subscribe to topics
await client.subscribe("/topic/my-topic")

# listen for incoming messages
async for message in client:
    # code to execute on receiving message
    ...

Is there anyway to cancel the client but allow it to continue processing the messages it has pref-etched?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions