Giter VIP home page Giter VIP logo

pub_sub's People

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pub_sub's Issues

Configurable suffix

Be able to supply a suffix for a given queue through configuration.
Right now when using docker, the current user is the same for multiple developers and the messages are colliding. This will enable us to write to different queues based off of individual ENV configuration.

The default could stay the same.

`whoami`.strip

Logs messages with the log level set on the Logger

lib/pub_sub/message.rb:24
lib/pub_sub/publisher.rb:35

Depending on the LOG_LEVEL set, it would use that level to do this specific log.
May we log this with a level that makes sense, like DEBUG or INFO?

Add :on option to publish_changes_with

This gem currently provides the publish_changes_with method, which can be used, for a given ActiveRecord model, to trigger a pub_sub event on an after_commit hook.

The after_commit will be fired whenever an action has been performed on a record, whether it was a touch, update, create or even a destroy action.

However, it's not uncommon to find use cases where we want to send a message only if the action performed was a deletion, or on on any action except deletion. As this method makes no distinction on what actions were made, the developer has to write their own callbacks rather than using this API.

This issue suggests an on option, to be included to the method in question.

Its parameter can be one of those symbols [or array of symbols containing one or more of them]: :create, :update, :save, :destroy, :touch.

Usage:

publish_changes_with :destroy_resource, on: :destroy
publish_changes_with :update_resource, on: [:save, :touch]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.