Categories: None [Edit]

improved-queue

https://rubygems.org/gems/improved-queue
A simple elaboration on Ruby's native SizedQueue which allows using the queue object to re-awaken a blocked thread and cause it to abandon its blocking enqueue/dequeue operation. Useful for simplifying program logic, reducing the need for external flags/Muteces (yes, I said Muteces), and for cleanly resolving queues on program termination without risk of data loss or deadlock. Why use this queue? There are two reasons. For one thing, under several circumstances it is _considerably_ faster than Ruby's native SizedQueue. I admit I'm not entirely sure why, but I have tested this on multiple platforms and it seems to hold true as a generality. You can feel free to confirm or dispel that this advantage holds for your use case at your own leisure. The second reason is the aforementioned simplification of program logic. In the case that all data passing through the queues must be preserved on program termination, SizedQueue can require some elaborate trickery to ensure that even the most remote possibility of deadlock is removed. ImprovedSizedQueue solves this problem by making it possible to use the queue to pass control messages between threads, irrespective of the queue's actual content.

Total

Ranking: 141,442 of 180,488
Downloads: 3,564

Daily

Ranking: 38,970 of 180,477
Downloads: 0

Depended by

RankDownloadsName

Depends on

RankDownloadsName

Owners

#GravatarHandle
1iconiamtheiconoclast