[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-8006":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":16,"stars7d":16,"stars30d":16,"stars90d":16,"forks30d":16,"starsTrendScore":16,"compositeScore":17,"rankGlobal":10,"rankLanguage":10,"license":18,"archived":19,"fork":19,"defaultBranch":20,"hasWiki":21,"hasPages":21,"topics":22,"createdAt":10,"pushedAt":10,"updatedAt":23,"readmeContent":24,"aiSummary":25,"trendingCount":16,"starSnapshotCount":16,"syncStatus":26,"lastSyncTime":27,"discoverSource":28},8006,"sneakers","jondot\u002Fsneakers","jondot","A fast background processing framework for Ruby and RabbitMQ","https:\u002F\u002Fgithub.com\u002Fjondot\u002Fsneakers",null,"Ruby",2240,321,37,51,0,59.52,"MIT License",false,"master",true,[],"2026-06-12 04:00:37","# Sneakers has a New Home and a New Name\n\n⚠️⚠️⚠️ Sneakers users have decided to continue with a new repo\nand a new name: meet [ruby-amqp\u002Fkicks](https:\u002F\u002Fgithub.com\u002Fruby-amqp\u002Fkicks).\n\nUnfortunately, this repo was abandoned by its original author who has exclusive control\nover the RubyGems project. So the community of users has [decided to move it](https:\u002F\u002Fgithub.com\u002Fjondot\u002Fsneakers\u002Fissues\u002F452)\nto a different \"fork\" (continuation) under a new name.\n\n## What is Sneakers\n\n```\n      __\n  ,--'  >\n  `=====\n\n```\n\nA high-performance RabbitMQ background processing framework for\nRuby.\n\nSneakers is being used in production for both I\u002FO and CPU intensive workloads, and have achieved the goals of high-performance and 0-maintenance, as designed.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'sneakers'\n```\n\nAnd then execute:\n\n```shell-session\n$ bundle\n```\n\nOr install it yourself as:\n\n```shell-session\n$ gem install sneakers\n```\n\n## Documentation\n\nA quick start guide is available in the section below.\n\nVisit the [wiki](https:\u002F\u002Fgithub.com\u002Fjondot\u002Fsneakers\u002Fwiki) for more detailed\ndocumentation and [GitHub releases](https:\u002F\u002Fgithub.com\u002Fjondot\u002Fsneakers\u002Freleases) for release\nnotes.\n\nA [change log](.\u002FChangeLog.md) is also available.\n\n## Quick start\n\nSet up a Gemfile\n\n```ruby\nsource 'https:\u002F\u002Frubygems.org'\ngem 'sneakers'\ngem 'json'\ngem 'redis'\n```\n\nHow do we add a worker? Firstly create a file and name it as `boot.rb`\nthen create a worker named as `Processor`.\n\n> touch boot.rb\n\n```ruby\nrequire 'sneakers'\nrequire 'redis'\nrequire 'json'\n\n$redis = Redis.new\n\nclass Processor\n  include Sneakers::Worker\n  from_queue :logs\n\n  def work(msg)\n    err = JSON.parse(msg)\n    if err[\"type\"] == \"error\"\n      $redis.incr \"processor:#{err[\"error\"]}\"\n    end\n\n    ack!\n  end\nend\n```\n\nLet's test it out quickly from the command line:\n\n```shell-session\n$ sneakers work Processor --require boot.rb\n```\n\nWe just told Sneakers to spawn a worker named `Processor`, but first `--require` a file that we dedicate to setting up environment, including workers and what-not.\n\nIf you go to your RabbitMQ admin now, you'll see a new queue named `logs` was created. Push a couple messages like below:\n\n```javascript\n{\n   \"type\": \"error\",\n   \"message\": \"HALP!\",\n   \"error\": \"CODE001\"\n}\n```\n\nPublish a message with the [bunny](https:\u002F\u002Fgithub.com\u002Fruby-amqp\u002Fbunny) gem RabbitMQ client:\n\n```ruby\nrequire 'bunny'\n\nconn = Bunny.new\nconn.start\n\nch = conn.create_channel\nch.default_exchange.publish({ type: 'error', message: 'HALP!', error: 'CODE001' }.to_json, routing_key: 'logs')\n\nconn.close\n```\n\nAnd this is the output you should see at your terminal.\n\n```\n2013-10-11T19:26:36Z p-4718 t-ovqgyb31o DEBUG: [worker-logs:1:213mmy][#\u003CThread:0x007fae6b05cc58>][logs][{:prefetch=>10, :durable=>true, :ack=>true, :heartbeat_interval=>2, :exchange=>\"sneakers\"}] Working off: log log\n2013-10-11T19:26:36Z p-4718 t-ovqgyrxu4 INFO: log log\n2013-10-11T19:26:40Z p-4719 t-ovqgyb364 DEBUG: [worker-logs:1:h23iit][#\u003CThread:0x007fae6b05cd98>][logs][{:prefetch=>10, :durable=>true, :ack=>true, :heartbeat_interval=>2, :exchange=>\"sneakers\"}] Working off: log log\n2013-10-11T19:26:40Z p-4719 t-ovqgyrx8g INFO: log log\n```\n\nWe'll count errors and error types with Redis.\n\n``` shell-session\n$ redis-cli monitor\n1381520329.888581 [0 127.0.0.1:49182] \"incr\" \"processor:CODE001\"\n```\n\nWe're basically done with the ceremonies and all is left is to do some real work.\n\n### Looking at metrics\n\nLet's use the `logging_metrics` provider just for the sake of fun of seeing the metrics as they happen.\n\n```ruby\n# boot.rb\nrequire 'sneakers'\nrequire 'redis'\nrequire 'json'\nrequire 'sneakers\u002Fmetrics\u002Flogging_metrics'\nSneakers.configure(metrics: Sneakers::Metrics::LoggingMetrics.new)\n\n# ... rest of code\n```\n\nNow push a message again and you'll see:\n\n```\n2013-10-11T19:44:37Z p-9219 t-oxh8owywg INFO: INC: work.Processor.started\n2013-10-11T19:44:37Z p-9219 t-oxh8owywg INFO: TIME: work.Processor.time 0.00242\n2013-10-11T19:44:37Z p-9219 t-oxh8owywg INFO: INC: work.Processor.handled.ack\n```\n\nWhich increments `started` and `handled.ack`, and times the work unit.\n\nFrom here, you can continue over to the\n[Wiki](https:\u002F\u002Fgithub.com\u002Fjondot\u002Fsneakers\u002Fwiki)\n\n# Docker\n\nIf you use Docker, there's some benefits to be had and you can use both\n`docker` and `docker-compose` with this project, in order to run tests,\nintegration tests or a sample worker without setting up RabbitMQ or the\nenvironment needed locally on your development box.\n\n* To build a container run `docker build . -t sneakers_sneakers`\n* To run non-integration tests within a docker container, run `docker run --rm\n  sneakers_sneakers:latest`\n* To run full integration tests within a docker topology including RabbitMQ,\n  Redis (for integration worker) run `scripts\u002Flocal_integration`, which will\n  use docker-compose to orchestrate the topology and the sneakers Docker image\n  to run the tests\n* To run a sample worker within Docker, try the `TitleScraper` example by\n  running `script\u002Flocal_worker`. This will use docker-compose as well. It will\n  also help you get a feeling for how to run Sneakers in a Docker based\n  production environment\n* Use `Dockerfile.slim` instead of `Dockerfile` for production docker builds.\n  It generates a more compact image, while the \"regular\" `Dockerfile` generates\n  a fatter image - yet faster to iterate when developing\n\n# Compatibility\n\n* Sneakers main branch: Ruby 3.0+\n* Sneakers 2.7.x and later (using Bunny 2.9): Ruby 2.2.x\n* Sneakers 1.1.x and later (using Bunny 2.x): Ruby 2.x\n* Sneakers 1.x.x and earlier: Ruby 1.9.x, 2.x\n\n# Contributing\n\nFork, implement, add tests, pull request, get my everlasting thanks and a respectable place here :).\n\n### Thanks:\n\nTo all Sneakers [Contributors](https:\u002F\u002Fgithub.com\u002Fjondot\u002Fsneakers\u002Fgraphs\u002Fcontributors) - you make this happen, thanks!\n\n# Copyright\n\nCopyright (c) 2015-2018 [Dotan Nahum](http:\u002F\u002Fgplus.to\u002Fdotan) [@jondot](http:\u002F\u002Ftwitter.com\u002Fjondot). See [LICENSE](LICENSE.txt) for further details.\n","Sneakers 是一个用于 Ruby 和 RabbitMQ 的高性能后台处理框架。它支持 I\u002FO 和 CPU 密集型工作负载，设计目标是实现高性能和零维护。通过使用 Sneakers，开发者可以轻松地创建、配置和管理后台任务，同时利用 RabbitMQ 的强大消息队列功能来保证消息的可靠传递。适合需要异步处理大量数据或执行耗时操作的应用场景，如日志处理、邮件发送、批处理等。尽管原项目已被弃用，但社区已将其迁移到新仓库 [ruby-amqp\u002Fkicks](https:\u002F\u002Fgithub.com\u002Fruby-amqp\u002Fkicks) 下继续维护和发展。",2,"2026-06-11 03:15:35","top_language"]