[#70843] Re: [ruby-cvs:58952] hsbt:r51801 (trunk): * lib/rubygems: Update to RubyGems HEAD(fe61e4c112). — Eric Wong <normalperson@...>
hsbt@ruby-lang.org wrote:
3 messages
2015/09/17
[ruby-core:70701] [Ruby trunk - Feature #11517] [Open] Queue enhancement - conditional pop
From:
jonathanscruz@...
Date:
2015-09-09 15:03:33 UTC
List:
ruby-core #70701
Issue #11517 has been reported by Jonathan Cruz. ---------------------------------------- Feature #11517: Queue enhancement - conditional pop https://bugs.ruby-lang.org/issues/11517 * Author: Jonathan Cruz * Status: Open * Priority: Normal * Assignee: Yukihiro Matsumoto ---------------------------------------- I’m submitting a patch to enhance Queue#pop. This allows the caller to provide a block that accepts data from the queue. Queue#pop will return the first element for which the block returns a truthy value, and remove it from the queue. Without a block, Queue#pop will behave the same way it currently does. The motivation for this enhancement: On our project, we have a queue of work and several worker threads. Some work can incur a heavy load on the system and should not be processed while another worker is processing 'heavy load' work. We need a way for Queue#pop to skip over heavy load items while another thread is processing heavy load work. ---Files-------------------------------- ruby_queue_conditional_pop.patch (3.76 KB) -- https://bugs.ruby-lang.org/