Socket
Book a DemoInstallSign in
Socket

acts_as_queue

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

acts_as_queue

0.1.7
bundlerRubygems
Version published
Maintainers
1
Created
Source

= acts_as_queue

{Gem Version}[http://badge.fury.io/rb/acts_as_queue] {Build Status}[https://travis-ci.org/matthewl/acts_as_queue] {Dependency Status}[https://gemnasium.com/matthewl/acts_as_queue]

acts_as_queue is a gem for ActiveRecord that allows you to turn any of your ActiveRecord models into a queue.

acts_as_queue provides you with methods to simplify using your ActiveRecord as a queue. The two key methods it provides are Push and Pop.

Push is used when you want to add an item to your queue. Pop is used when you need to process or remove the earliest item from your queue.

== Using the default unbounded queue

class Post < ActiveRecord::Base acts_as_queue end

Pushing new posts onto the queue.

Post.push :name => "Hello World" Post.push :name => "Using Rails"

Popping the item at the front of the queue.

Post.pop

== Using a bounded queue

class Message < ActiveRecord::Base acts_as_queue :size => 10 end

Pushing 20 new messages onto the queue.

(1..20).each { |i| Message.push :description => "Message #{i}" }

Message.count # Just 10 messages on the queue

FAQs

Package last updated on 16 Mar 2014

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.