fritzy / SleekXMPP

Python 2.6+/3.1+ XMPP Library
http://groups.google.com/group/sleekxmpp-discussion
Other
1.1k stars 299 forks source link

Priority queue for outbound messages #70

Closed macdiesel closed 13 years ago

macdiesel commented 13 years ago

There are situations where it may the outbound send queue may become backed up (for example if the client is on a slow internet connection, or a connection that may loose it's internet connection). Should this queue back up it it's diserable to be able to push messages to the front of the queue so they would go out first. An example of this are messages related to connection, but could also be sending messages before in-band file transfer iq's.

I have created a patch to add this to sleek xmpp. All interfaces basically stay the same. Lowest number items get picked off the queue first for sending.

Patch commit: https://github.com/macdiesel/SleekXMPP/commit/5eda1640f937e4f461572ff882a42c970a9b1bf0

legastero commented 13 years ago

I like priority queues; this should definitely be added. We will probably define a few priority levels instead of hard coding values though.

Did you find using priorities insufficient for stream initiation (since you also have issue #72)?

macdiesel commented 13 years ago

We scrapped this in favor of moving stream initiation out of the initial output stream processing. In our current branch we do not process the send queue while the client is not connected, instead opting to send stream initiation messages directly using a different method. This solved 2 issues for us: 1) messages that may have been left on the send queue from a prior connection or from a prior connection attempt will not be processed potential mucking up a connection attempt (had this happen often) 2) made starting and stopping sleekxmpp's connection more reliable.

I am going to close this issue as we have solved this issue a different and with the implementation some new stuff in the send method such as the new=True, this ticket really isn't relevant any longer.