On 18 October 2016 at 22:13, Justin Ross <justin.r...@gmail.com> wrote:
> https://gist.github.com/ssorj/1ccf4d1499563722bc419f1e1fac11bf
>
> In this example, there is still ample credit on the link after the last
> on_sendable() is printed, but on_sendable is never fired again.  Is that
> expected behavior?
>
> It appears that on_link_flow is only fired when link credit is updated, and
> on_link_flow is the source of all on_sendable events.
>
> https://github.com/apache/qpid-proton/blob/master/proton-c/bindings/python/proton/handlers.py#L36

Thats my understanding from past discussion on these bits. Flow events
are raised when a flow frame arrives from the peer, and also generated
when sends occur on sending links, I believe to represent that 'credit
has changed' (I added a flag in proton-j to allow disabling that,
since it makes no sense in many cases). The on_sendable callback then
fires when a flow event is handled and there is actually credit to
send messages.

If the last sendable callback is triggered and you dont have anything
to send, then you wont get any more sendable callbacks until more
credit arrives from the peer, which if you arent doing anything such
as sending it messages, its likely it will never give. Essentially at
that point you have been told there is credit to send messages, and
its up to you to react and manage doing something to send them [on the
container thread] once you do have something to send.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@qpid.apache.org
For additional commands, e-mail: users-h...@qpid.apache.org

Reply via email to