Sha256: 0c16ff22182fb1d02a97cd7f885947abe4071a5057a99677bc2df289d1c66404

Contents?: true

Size: 908 Bytes

Versions: 23

Compression:

Stored size: 908 Bytes

Contents

# frozen_string_literal: true

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

23 entries across 23 versions & 1 rubygems

Version Path
praxis-2.0.0 lib/praxis/notifications.rb
praxis-2.0.pre.40 lib/praxis/notifications.rb
praxis-2.0.pre.39 lib/praxis/notifications.rb
praxis-2.0.pre.38 lib/praxis/notifications.rb
praxis-2.0.pre.37 lib/praxis/notifications.rb
praxis-2.0.pre.36 lib/praxis/notifications.rb
praxis-2.0.pre.35 lib/praxis/notifications.rb
praxis-2.0.pre.34 lib/praxis/notifications.rb
praxis-2.0.pre.33 lib/praxis/notifications.rb
praxis-2.0.pre.32 lib/praxis/notifications.rb
praxis-2.0.pre.31 lib/praxis/notifications.rb
praxis-2.0.pre.30 lib/praxis/notifications.rb
praxis-2.0.pre.29 lib/praxis/notifications.rb
praxis-2.0.pre.28 lib/praxis/notifications.rb
praxis-2.0.pre.27 lib/praxis/notifications.rb
praxis-2.0.pre.26 lib/praxis/notifications.rb
praxis-2.0.pre.25 lib/praxis/notifications.rb
praxis-2.0.pre.24 lib/praxis/notifications.rb
praxis-2.0.pre.23 lib/praxis/notifications.rb
praxis-2.0.pre.22 lib/praxis/notifications.rb