An open API service indexing awesome lists of open source software.

https://github.com/cjhdev/timeout_queue

Like Ruby Queue but supports pop timeout
https://github.com/cjhdev/timeout_queue

queue ruby timeout

Last synced: about 1 year ago
JSON representation

Like Ruby Queue but supports pop timeout

Awesome Lists containing this project

README

          

timeout_queue
=============

It's like Queue except:

- #pop has an optional timeout
- #unshift will put an object on the front of the queue
- #delete can remove an object from the queue

## Usage

Install as a Gem using your preferred method.

Require:

~~~
require 'timeout_queue'
~~~

Use:

~~~
q = TimeoutQueue.new

begin

# wait for no more than one second
q.pop(timeout: 1)

rescue ThreadError

# you timed out

end
~~~

## License

timeout_queue has an MIT license.