
Security News
Follow-up and Clarification on Recent Malicious Ruby Gems Campaign
A clarification on our recent research investigating 60 malicious Ruby gems.
A ridiculously simple queuing system, with clients in various languages, built on top of MongoDB.
Writing to a queue
require 'karait'
queue = Karait::Queue.new(
:host => 'localhost', # MongoDB host. Defaults to localhost.
:port => 27017, # MongoDB port. Defaults to 27017.
:database => 'karait', # Database that will store the karait queue. Defaults to karait.
:queue => 'messages', # The capped collection that karait writes to. Defaults to messages.
:average_message_size => 8192, # How big do you expect the messages will be in bytes? Defaults to 8192.
:queue_size => 4096 # How many messages should be allowed in the queue. Defaults to 4096.
)
queue.write({
:name => 'Benjamin',
:action => 'Rock'
})
# or
message = Karait::Message.new
message.name = 'Benjamin'
message.action = 'Rock!'
queue.write(message, :routing_key => 'my_routing_key', :expire => 3.0)
Reading from a queue
require 'karait'
queue = Karait::Queue.new
message = queue.read().first
print "#{message.name}"
message.delete
# or
message = queue.read(:routing_key => 'my_routing_key').first
print "#{message.action}"
message.delete
See unit tests for more documentation.
Copyright (c) 2011 Attachments.me. See LICENSE.txt for further details.
FAQs
Unknown package
We found that karait demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A clarification on our recent research investigating 60 malicious Ruby gems.
Security News
ESLint now supports parallel linting with a new --concurrency flag, delivering major speed gains and closing a 10-year-old feature request.
Research
/Security News
A malicious Go module posing as an SSH brute forcer exfiltrates stolen credentials to a Telegram bot controlled by a Russian-speaking threat actor.