0.0
No commit activity in last 3 years
No release in over 3 years
A simple client for using semq message servers. Supports push and pop methods to named queues. Pop can wait indefinitely, using long polling to remain lightweight.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies
 Project Readme

ruby-semq

This is a ruby gem to support getting items from a semq queue and pushing items onto it. Due to the simplicity of the semq interface, there is only a single class with two methods.

Usage:

Create a new queue with the server location and queue name

queue = new Semq("http://localhost:8080", "myMessageQueue")

Put an item in a queue.

queue.push("A string")

Get the next item on the queue (blocking, will wait until there is an item to return).

nextitem = queue.pop

pop will wait indefinitely for an item to be placed on the queue. If you wish to time out, there is an optional parameter, timeout_in_seconds. The function will return after your specified timeout but it can take longer than the specified timeout, as it will always be aligned with a return from the semq server.

Returns after roughly two minutes if no messages are put onto the queue

nextitem = queue.pop(120)

If the semq server is configured with a 20s long polling time then the following will return after roughly twenty seconds, despite the 1s timeout

queue.pop(1)