This is very simple, pure thread-based implementation of message processor without hard dependencies (only aws, thread, thread_safe gems are used).
Add this line to your application's Gemfile:
gem 'sqs', github: 'fatum/sqs'
And then execute:
$ bundle
worker = Sqs::Worker.new(
queue: "queue",
worker_size: 1,
poller_size: 1
)
worker.execute do |message|
p message.body
sleep 1
end
- Low memory footprint
- Pure thread-based implementation without sleep (mutex with cond var) and without celluloid
- Cross platform
- Pool with auto shrinking idle threads
- Multiple pollers
- Trap signals (can be running by upstart)
v1.0.0
- Rename project to Sqs
- Added logger option
v0.2.3
- Upgrade aws-sdk to v2.1
v0.2.2
- Trap TTIN signal in separate thread
v0.2.1
- Fix stopped pooler after idle_timeout
v0.2.0
- Use aws-sdk v2 (with patch for memory leak on ruby 2.2)
- Really low memory footprint (40mb)
- Batch messages
After checking out the repo, run bin/setup
to install dependencies. Then, run bin/console
for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run bundle exec rake install
. To release a new version, update the version number in version.rb
, and then run bundle exec rake release
to create a git tag for the version, push git commits and tags, and push the .gem
file to rubygems.org.
- Fork it ( https://github.com/[my-github-username]/simple-sqs/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request