{"id":21201675,"url":"https://github.com/oleander/postpone-rb","last_synced_at":"2025-07-05T15:06:11.357Z","repository":{"id":2317053,"uuid":"3277298","full_name":"oleander/postpone-rb","owner":"oleander","description":"A Beanstalkd backed asynchronous priority queue","archived":false,"fork":false,"pushed_at":"2012-01-26T21:42:35.000Z","size":96,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-03-15T11:22:59.104Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"TotalFreedom/TF-WorldEdit","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/oleander.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-01-26T20:48:00.000Z","updated_at":"2014-03-19T09:30:51.000Z","dependencies_parsed_at":"2022-08-31T18:50:20.255Z","dependency_job_id":null,"html_url":"https://github.com/oleander/postpone-rb","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oleander%2Fpostpone-rb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oleander%2Fpostpone-rb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oleander%2Fpostpone-rb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oleander%2Fpostpone-rb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oleander","download_url":"https://codeload.github.com/oleander/postpone-rb/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243654400,"owners_count":20325893,"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-11-20T20:10:28.415Z","updated_at":"2025-03-14T22:26:02.122Z","avatar_url":"https://github.com/oleander.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Postpone\n\nA [Beanstalkd](http://kr.github.com/beanstalkd/) backed asynchronous priority queue.\n\n## Why beanstalkd?\n\nIn contrast to other asynchronous priority queues Beanstalkd doesn't use  \npolling behind the scene. This means that your jobs will start faster.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n``` ruby\ngem \"postpone\"\n```\n\nAnd then execute:\n```\n$ bundle\n```\n\nOr install it yourself as:\n```    \n$ gem install postpone\n```\n\nDon't forget to install and start the [beanstalkd bin](http://kr.github.com/beanstalkd/download.html).\n\n## Invoke\n\nCall `postpone` on any given object to *postpone* the execution.\n\n``` ruby\nUser.first.postpone.notify!\n```\n\n*Postpone* **cannot** postpone blocks. Why is explained [here](http://stackoverflow.com/a/38588/560073).\n\n``` ruby\nUser.first.postpone.notify! { \"How do you do?\" }\n```\n\n## Worker\n\n*Postpone* is build on top of [beanstalkd](http://kr.github.com/beanstalkd/) and [stalker](https://github.com/adamwiggins/stalker) which means that you need an external worker.\n\n### Creating a worker\n\nCreate a file called `jobs.rb` and add the following code to it\n\n``` ruby\nrequire \"postpone/worker\"\n```\n\nAdd your own worker to the same file, if you have any.  \nTake a look at the [official stalker repo](https://github.com/han/stalker) for more information.\n\n``` ruby\nStalker::job \"email.send\" do |args|\n  Pony.send(to: args['to'], subject: \"Hello there\")\nend\n```\n\nStart your worker using `stalk jobs.rb`\n\n## Hint\n\nKeep in mind that the object you are trying to *postpone* needs to be available on both sides.\nSo if you're trying to *postpone* an operation on a rails object you need to load the rails environment on the worker side too.\n\n``` ruby\n# Loading rails\nrequire File.expand_path(\"../environment\", __FILE__)\n\n# Loading postpone\nrequire \"postpone/worker\"\n```\n\n## Alternatives\n\n- [Delayed job](https://github.com/tobi/delayed_job) \n- [resque](https://github.com/defunkt/resque)\n\n## Testing\n\nStart by installing [rspec](https://github.com/dchelimsky/rspec).  \nThen, run the tests using `rspec .`\n\n## Contributing\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Added some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create new Pull Request\n\n## License\n\n*Postpone* is released under the *MIT License*.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foleander%2Fpostpone-rb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foleander%2Fpostpone-rb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foleander%2Fpostpone-rb/lists"}