
Security News
Astral Launches pyx: A Python-Native Package Registry
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.
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
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.
Security News
The Latio podcast explores how static and runtime reachability help teams prioritize exploitable vulnerabilities and streamline AppSec workflows.
Security News
The latest Opengrep releases add Apex scanning, precision rule tuning, and performance gains for open source static code analysis.