{"id":22112420,"url":"https://github.com/lukeredpath/beanstalk-messaging","last_synced_at":"2025-07-25T07:33:00.094Z","repository":{"id":419967,"uuid":"39779","full_name":"lukeredpath/beanstalk-messaging","owner":"lukeredpath","description":null,"archived":false,"fork":false,"pushed_at":"2009-02-15T16:49:29.000Z","size":191,"stargazers_count":12,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2023-04-09T05:47:02.871Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"saimonmoore/dm-counter-cache","license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lukeredpath.png","metadata":{"files":{"readme":"README.textile","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2008-08-04T08:25:53.000Z","updated_at":"2019-08-13T13:30:45.000Z","dependencies_parsed_at":"2022-07-07T18:12:20.969Z","dependency_job_id":null,"html_url":"https://github.com/lukeredpath/beanstalk-messaging","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukeredpath%2Fbeanstalk-messaging","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukeredpath%2Fbeanstalk-messaging/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukeredpath%2Fbeanstalk-messaging/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukeredpath%2Fbeanstalk-messaging/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lukeredpath","download_url":"https://codeload.github.com/lukeredpath/beanstalk-messaging/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227544114,"owners_count":17785198,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-01T10:57:52.366Z","updated_at":"2024-12-01T10:57:52.471Z","avatar_url":"https://github.com/lukeredpath.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"h1. Beanstalk Messaging Plugin for Rails\n\nThe Beanstalk Messaging Plugin provides a simple interface to the +beanstalkd+ queuing\nprocess.\n\nh2. Configuration\n\nCopy beanstalk.example.yml from the plugin config folder to your Rails config folder \nand configure the queues that you need for your application. Use script/beanstalk to \nstart/stop/restart your beanstalkd processes.\n\nh2. Using the Beanstalk::QueueManager\n\nUse the Beanstalk::QueueManager class to access your queues by name, using the \nBeanstalk::QueueManager#queue method. For example:\n\n  queue_manager = BeanStalk::QueueManager.new(\"beanstalk-config.yml\")\n  my_queue = queue_manager.queue(:my_queue)\n  my_queue \u003c\u003c \"Here's a message\"\n\nIn your +environment.rb+ file, you should create a single instance of a Beanstalk::QueueManager \nusing your +beanstalk.yml+ config as a global constant that you can use throughout your app. This \nwill ensure that each request to QueueManager.queue returns the same Beanstalk::Queue \ninstance. For example, you may wish to add the following to the bottom of +environment.rb+:\n\n  QUEUE_MANAGER = Beanstalk::QueueManager.new(File.join(RAILS_ROOT, 'config', 'beanstalk.yml'))\n  \nYou can disable queues globally by using the Beanstalk::QueueManager#disable method to temporarily \ndisable the use of that particular queue. Beanstalk::QueueManager#disable_all disables all queues. \nWhen a queue is disabled, the Beanstalk::QueueManager will return a Beanstalk::NullQueue instead of an actual \nBeanstalk::Queue object which will handle any Beanstalk::Queue API calls silently:\n\n\u003cpre\u003e\u003ccode\u003e\n# In environment.rb\nQUEUE_MANAGER.disable(:my_queue)\n\n## Elsewhere in your application...\nqueue = QUEUE_MANAGER.queue(:my_queue)\n100.times { queue \u003c\u003c \"In /dev/null, noone can hear you scream...\" }\n## Nothing actually gets sent to the beanstalkd process\n\u003c/code\u003e\u003c/pre\u003e\n\nh2. Using Beanstalk::Queue\n\nUse the Beanstalk::Queue API to push messages on to the queue and consume messages. This\namounts to using Beanstalk::Queue#push (or Beanstalk::Queue#\u003c\u003c) to add messages to the queue,\nand Beanstalk::Queue#next_message to retrieve messages. Note that you do not need to\ntransform the data into YAML - this is performed automatically by the queue.\n\n\u003cpre\u003e\u003ccode\u003e\nqueue \u003c\u003c [1,2,3]\n# =\u003e \"---\\n1\\n2\\n3\" # YAML version ends up on the queue\n\nqueue.next_message\n# =\u003e [1,2,3] # YAML deserialization is performed automatically\n\u003c/code\u003e\u003c/pre\u003e\n \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flukeredpath%2Fbeanstalk-messaging","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flukeredpath%2Fbeanstalk-messaging","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flukeredpath%2Fbeanstalk-messaging/lists"}