Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need for more FlowControl? #56

Open
tvoinarovskyi opened this issue Oct 18, 2015 · 1 comment
Open

Need for more FlowControl? #56

tvoinarovskyi opened this issue Oct 18, 2015 · 1 comment
Milestone

Comments

@tvoinarovskyi
Copy link
Contributor

Seems like Rabbitmq has a FlowControl system. I didn't work to much with Rabbitmq, so I don't know much about it.
Apart from that the rabbitmq spec says that there are methods to start/stop flow of data, does the library need to respect it?

Why I am bringing this up? Right now the exchange.publish is not a coroutine. It sends data to socket without any checks. It's an issue if we want to:

The questing is: What changes to the API would make those cases implementable?

@tvoinarovskyi
Copy link
Contributor Author

I don't really want to break the API by making publish a coroutine. How about the publish method will return an object, that can be asked about published message state? Something like:

connection = yield from connect()
channel = yield from connection.open_channel()
channel.confirm_delivery()
exchange = yield from get_exchange(channel)
msg_monitor = exchange.publish()

if connection.paused:  # Indicates if protocol writing was paused
    yield from connection.flush()  # Will flush write buffers. This can be used after a large pack of publish's

yield from msg_monitor.wait_ack()  # Will wait for ACK. Will raise error if used without confirm_delivery()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants