Sha256: 1dcf022880e1fe7baebd4b4a157653864829e2b9ee40ea569c14c24a202944a7

Contents?: true

Size: 881 Bytes

Versions: 17

Compression:

Stored size: 881 Bytes

Contents

require 'active_support/notifications'

require 'singleton'

module Praxis

  module Notifications
    include Praxis::PluginConcern

    class Plugin < Praxis::Plugin
      include Singleton

      def config_key
        :notifications # 'praxis.notifications'
      end

    end

    def self.publish(name, *args)
      ActiveSupport::Notifications.publish(name, *args)
    end

    def self.instrument(name, payload = {}, &block)
      ActiveSupport::Notifications.instrument(name, **payload, &block)
    end

    def self.subscribe(*args, &block)
      ActiveSupport::Notifications.subscribe(*args, &block)
    end

    def self.subscribed(callback, *args, &block)
      ActiveSupport::Notifications.subscribed(callback, *args, &block)
    end

    def self.unsubscribe(subscriber_or_name)
      ActiveSupport::Notifications.unsubscribe(subscriber_or_name)
    end


  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
praxis-2.0.pre.18 lib/praxis/notifications.rb
praxis-2.0.pre.17 lib/praxis/notifications.rb
praxis-2.0.pre.16 lib/praxis/notifications.rb
praxis-2.0.pre.15 lib/praxis/notifications.rb
praxis-2.0.pre.14 lib/praxis/notifications.rb
praxis-2.0.pre.13 lib/praxis/notifications.rb
praxis-2.0.pre.12 lib/praxis/notifications.rb
praxis-2.0.pre.11 lib/praxis/notifications.rb
praxis-2.0.pre.10 lib/praxis/notifications.rb
praxis-2.0.pre.9 lib/praxis/notifications.rb
praxis-2.0.pre.8 lib/praxis/notifications.rb
praxis-2.0.pre.7 lib/praxis/notifications.rb
praxis-2.0.pre.6 lib/praxis/notifications.rb
praxis-2.0.pre.5 lib/praxis/notifications.rb
praxis-2.0.pre.4 lib/praxis/notifications.rb
praxis-2.0.pre.3 lib/praxis/notifications.rb
praxis-2.0.pre.2 lib/praxis/notifications.rb