# Task/work queue

**URL:** <https://www.ruby-forum.com/t/task-work-queue/173883>\
**Category:** Ruby\
**Created:** [August 17, 2009, 5:46pm UTC](https://www.ruby-forum.com/t/task-work-queue/173883 "2009-08-17T17:46:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![gurpal2000](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/54ee81/32.png) [@gurpal2000](https://www.ruby-forum.com/u/gurpal2000)\
**Post date:** [August 17, 2009, 5:46pm UTC](https://www.ruby-forum.com/t/task-work-queue/173883/1 "2009-08-17T17:46:44Z")

</div>

Hi

I have created essentially a webapp using sinatra/webrick which allows a  
user to queue bits of work. These bits of work are essentially long  
running processes.

So i was thinking of using the Queue class to queue these requests and a  
different thread to work thru the list (for example encoding videos).

The user should be able to check on the progress of list AND  
reorder/move items up/down the list.

Now i’ve hand written stuff like this in java/servlet, but in Ruby  
what’s the best way to ensure that the queue can be enumerated in a  
synchronized way? and in a Queue what’s the best way to reorder items?  
would i have to use an indexed/synchronized array or something?

Any pointers helpful

Thanks

---

<div class="post-metadata">

**Author:** ![gurpal2000](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/54ee81/32.png) [@gurpal2000](https://www.ruby-forum.com/u/gurpal2000)\
**Post date:** [August 17, 2009, 7:46pm UTC](https://www.ruby-forum.com/t/task-work-queue/173883/2 "2009-08-17T19:46:31Z")

</div>

On Mon, Aug 17, 2009 at 11:46 AM, Gurpal 2000 [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> reorder/move items up/down the list.  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).

Check out this list of Queuing libraries for Ruby on Ruby Toolbox:  
[http://ruby-toolbox.com/categories/queueing.html](http://ruby-toolbox.com/categories/queueing.html). You might not find  
anything that fits your requirements exactly, but you could definitely  
find  
some inspiration there.

Mike
