Module: Wisper
- Defined in:
- lib/wisper/registration/block.rb,
lib/wisper.rb,
lib/wisper/version.rb,
lib/wisper/publisher.rb,
lib/wisper/configuration.rb,
lib/wisper/global_listeners.rb,
lib/wisper/registration/object.rb,
lib/wisper/temporary_listeners.rb,
lib/wisper/value_objects/events.rb,
lib/wisper/value_objects/prefix.rb,
lib/wisper/registration/registration.rb,
lib/wisper/broadcasters/send_broadcaster.rb,
lib/wisper/broadcasters/logger_broadcaster.rb
Overview
Provides a way of wrapping another broadcaster with logging
Defined Under Namespace
Modules: Broadcasters, Publisher, ValueObjects
Classes: BlockRegistration, Configuration, GlobalListeners, ObjectRegistration, Registration, TemporaryListeners
Constant Summary
collapse
- VERSION =
"3.0.0"
Class Method Summary
collapse
Class Method Details
.configuration ⇒ Object
54
55
56
|
# File 'lib/wisper.rb', line 54
def self.configuration
@configuration ||= Configuration.new
end
|
50
51
52
|
# File 'lib/wisper.rb', line 50
def self.configure
yield(configuration)
end
|
.publisher ⇒ Object
42
43
44
|
# File 'lib/wisper.rb', line 42
def self.publisher
Publisher
end
|
.setup ⇒ Object
58
59
60
61
62
|
# File 'lib/wisper.rb', line 58
def self.setup
configure do |config|
config.broadcaster(:default, Broadcasters::SendBroadcaster.new)
end
end
|
.subscribe(*args, **kwargs, &block) ⇒ Object
Examples:
Wisper.subscribe(AuditRecorder.new)
Wisper.subscribe(AuditRecorder.new, StatsRecorder.new)
Wisper.subscribe(AuditRecorder.new, on: 'order_created')
Wisper.subscribe(AuditRecorder.new, scope: 'MyPublisher')
Wisper.subscribe(AuditRecorder.new, StatsRecorder.new) do
end
.unsubscribe(*listeners) ⇒ Object