All Projects → giftcardzen → La_gear

giftcardzen / La_gear

Licence: mit
What do you get when you glue sneakers and sidekiq together? la_gear! Pump it up!

Programming Languages

ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to La gear

Dtcqueuebundle
Symfony2/3/4/5 Queue Bundle (for background jobs) supporting Mongo (Doctrine ODM), Mysql (and any Doctrine ORM), RabbitMQ, Beanstalkd, Redis, and ... {write your own}
Stars: ✭ 115 (+1337.5%)
Mutual labels:  workers, rabbitmq
taskinator
A simple orchestration library for running complex processes or workflows in Ruby
Stars: ✭ 25 (+212.5%)
Mutual labels:  sidekiq, workers
Yii2 Rabbitmq
RabbitMQ Extension for Yii2
Stars: ✭ 52 (+550%)
Mutual labels:  workers, rabbitmq
Sidekiq Job Php
Push and schedule jobs to Sidekiq from PHP
Stars: ✭ 34 (+325%)
Mutual labels:  workers, sidekiq
ponos
An opinionated queue based worker server for node.
Stars: ✭ 85 (+962.5%)
Mutual labels:  rabbitmq, workers
jobqueue
Jobqueue manages running and scheduling jobs (think Sidekiq or Resque for Go).
Stars: ✭ 37 (+362.5%)
Mutual labels:  sidekiq, workers
Task bunny
TaskBunny is a background processing application written in Elixir and uses RabbitMQ as a messaging backend
Stars: ✭ 193 (+2312.5%)
Mutual labels:  workers, rabbitmq
Verk
A job processing system that just verks! 🧛‍
Stars: ✭ 666 (+8225%)
Mutual labels:  workers, sidekiq
celery-connectors
Want to handle 100,000 messages in 90 seconds? Celery and Kombu are that awesome - Multiple publisher-subscriber demos for processing json or pickled messages from Redis, RabbitMQ or AWS SQS. Includes Kombu message processors using native Producer and Consumer classes as well as ConsumerProducerMixin workers for relay publish-hook or caching
Stars: ✭ 37 (+362.5%)
Mutual labels:  rabbitmq, workers
rails async migrations
Asynchronous support for ActiveRecord::Migration
Stars: ✭ 56 (+600%)
Mutual labels:  sidekiq, workers
Flower
Real-time monitor and web admin for Celery distributed task queue
Stars: ✭ 5,036 (+62850%)
Mutual labels:  workers, rabbitmq
Gush
Fast and distributed workflow runner using ActiveJob and Redis
Stars: ✭ 894 (+11075%)
Mutual labels:  workers, sidekiq
Pitstop
This repo contains a sample application based on a Garage Management System for Pitstop - a fictitious garage. The primary goal of this sample is to demonstrate several software-architecture concepts like: Microservices, CQRS, Event Sourcing, Domain Driven Design (DDD), Eventual Consistency.
Stars: ✭ 708 (+8750%)
Mutual labels:  rabbitmq
Orcinus
Agnostic Orchestration Tools
Stars: ✭ 17 (+112.5%)
Mutual labels:  workers
Sidekiq Statistic
See statistic about your workers
Stars: ✭ 709 (+8762.5%)
Mutual labels:  sidekiq
Bifrost
Bifrost ---- 面向生产环境的 MySQL 同步到Redis,MongoDB,ClickHouse,MySQL等服务的异构中间件
Stars: ✭ 701 (+8662.5%)
Mutual labels:  rabbitmq
Remit
RabbitMQ-backed microservices supporting RPC, pubsub, automatic service discovery and scaling with no code changes.
Stars: ✭ 24 (+200%)
Mutual labels:  rabbitmq
Rabbitmq Msg Store Index Eleveldb
LevelDB-based message store index for RabbitMQ
Stars: ✭ 16 (+100%)
Mutual labels:  rabbitmq
Spring Boot Examples
about learning Spring Boot via examples. Spring Boot 教程、技术栈示例代码,快速简单上手教程。
Stars: ✭ 26,812 (+335050%)
Mutual labels:  rabbitmq
Simplemall
基于SpringCloud的微服务架构实战案例项目,以一个简单的购物流程为示例,融合spring cloud 相关组件,如spring-cloud-netflix、swagger等
Stars: ✭ 687 (+8487.5%)
Mutual labels:  rabbitmq

L.A. Gear

This gem has two primary purposes:

  • Allowing you to define one worker class that has your sneakers worker queue configuration and the sidekiq perform method that actually processes the message.
  • DRYing up your sneakers configuration by using a conventions.

Here are some other features:

  • Messages are deserialized as JSON by default and the properties are passed to Sidekiq's perform_async method
  • Out-of-the-box configuration of sneakers for multiple RabbitMQ subscribers
  • An alternative to the Sneakers::Publisher#publish method that allows you to pass in more options when publishing to a RabbitMQ exchange
  • Helper methods for configuring sneakers
  • Support for configuring sneakers with BigWig

Build status

Installation

Add this line to your application's Gemfile:

gem 'la_gear'

And then execute:

$ bundle

Or install it yourself as:

$ gem install la_gear

Usage

Instead of include Sneakers::Worker in your workers, use include LaGear::Worker. Then all of your queues and routing key bindings will automatically use an Sneakers::Config[:app_name] plus the class name of your worker as your queue name and the class name of your worker as the routing key. For example,

Sneakers.configure app_name: 'pogs_are_awesome'

class BoKnows
  include LaGear::Worker

  def perform(baseball, football)
    # process message ...
  end
end

would by default result in the following 2 queue names:

  • pogs_are_awesome.bo_knows
  • pogs_are_awesome.bo_knows.retry

The default routing key would be: bo_knows. This allows for multiple consumer queue bindings for a direct exchange (see the Multiple Bindings section of https://www.rabbitmq.com/tutorials/tutorial-four-ruby.html). The .retry is for if you are using dead letter exchanges and message expirations to perform retries (which you should). Just call the subscribes_to method to override the convention-based defaults like so:

class PowerRanger
  include LaGear::Worker

  subscribes_to 'bo_knows'

  def perform(red, yellow)
    # process message...
  end
end

Or subscribe to multiple routing keys:

subscribes_to ['bo_knows', 'pump_it_up']

Also, notice in the example above that we don't define a work method for Sneakers::Worker. That's because LaGear::Worker defines it for you. All the method does is deserialize your RabbitMQ message (defaults to JSON) and pass each of the properties as a parameters to Sidekiq's perform_async method to process the message. Put your message processing code in a perform method instead. That's the method that Sidekiq invokes when it actually processes the message that LaGear::Worker#work sent to it.

You can also use the conventions to create versioned workers to more easily handle backwards compatibility when message parameters change. This module/class:

module BoKnows
  class V1
    def perform
      # process message...
    end
  end
end

would create the routing key bo_knows.v1 and these queue names:

  • pogs_are_awesome.bo_knows.v1
  • pogs_are_awesome.bo_knows.v1.retry

One caveat with subscribes_to and versioned workers is that the routing key must be manually incremented when a handler's version increments. If a worker subscribes_to 'bo_knows.v1', and the bo_knows.v1 message type increments to bo_knows.v2, you should create a new version of the worker that subscribes to bo_knows.v2.

The Bus

There is also a LaGear::Bus class which is an alternative to the Sneakers::Publisher. It adds an opts parameter to the publish method, allowing you to pass the options you would pass to the bunny exchange publish method (see http://reference.rubybunny.info/Bunny/Exchange.html#publish-instance_method for the list of options). It also allows you use a common way to publish messages:

  • LaGear::Bus.publish('bo_knows', baseball: 'royals', football: 'cowboys')
  • LaGear::Bus.publish('bo_knows', { baseball: 'royals', football: 'cowboys' }, version: 2) - will publish to the exchange with the bo_knows.v2 routing key
  • LaGear::Bus.publish_in(1.day, 'bo_knows', baseball: 'royals', football: 'cowboys')
  • LaGear::Bus.publish_at(1.day.from_now, 'bo_knows', baseball: 'royals', football: 'cowboys')
  • LaGear::Bus.publish_local('bo_knows_local', baseball: 'royals', football: 'cowboys') - this is for local only (include Sidekiq::Worker) workers
  • LaGear::Bus.publish_local_in('bo_knows', { baseball: 'royals', football: 'cowboys' }, 1.day)

Contributing

  1. Fork it ( https://github.com/[my-github-username]/la_gear/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].