Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

event_notifier

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

event_notifier

  • 1.0.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

= EventNotifier

Listen for database events like create new record, updated existing or destroy & notify. These events can be used with ActionController::Live or Server Sent Events (SSE)

== Installation

Simply add event_notifier gem to your Gemfile.

gem 'event_notifier'

& from terminal, run:

bundle install

== Usage

class Account < ActiveRecord::Base
    include EventNotifier

    .....

end

and inside your controller / SSE or wherever you want to use database events,

class AccountsController < ApplicationController

    def sse_live
        Account.on_event do |_event|
            sse.write(_event) # or whatever you want to do when a new account is created or existing account object is updated or destroyed
        end
    end
end
            

And now you are ready to track database event notifications.

p.s. Currently only create/update & destory events are handled

== TODO

  • Configuration options for events to handle
  • MongoDB support

== Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

FAQs

Package last updated on 13 Jul 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc