maidsafe-archive / socket-collection

Collection of sockets wrapped for convenience
BSD 3-Clause "New" or "Revised" License
6 stars 11 forks source link

revert outgoing message dropping logic #22

Closed povilasb closed 5 years ago

povilasb commented 5 years ago

Background

socket-collection outgoing data is stored in multiple queues with different priorities. Those queues are ordered by priorities. Every message also has a timestamp and could expire. socket-collection drops queues with expired messages.

Expired queues

The whole queue is considered expired, if it's first message got expired. Then socket-collection will drop expired outgoing queues. The way it collects expired queues might be unexpected: it doesn't filter all queues that got expired, but instead iterates trough all queues in order by priority, skips not expired queues, finds the first expired one and drops it together with all queues with subsequent priorities.