Module: Emittance

Defined in:
lib/emittance.rb,
lib/emittance/event.rb,
lib/emittance/action.rb,
lib/emittance/broker.rb,
lib/emittance/errors.rb,
lib/emittance/emitter.rb,
lib/emittance/version.rb,
lib/emittance/watcher.rb,
lib/emittance/notifier.rb,
lib/emittance/brokerage.rb,
lib/emittance/dispatcher.rb,
lib/emittance/event_lookup.rb,
lib/emittance/brokers/synchronous.rb,
lib/emittance/helpers/string_helpers.rb,
lib/emittance/dispatchers/synchronous.rb,
lib/emittance/helpers/constant_helpers.rb,
lib/emittance/dispatcher/registration_map.rb,
lib/emittance/dispatcher/registration_collection_proxy.rb

Overview

The base namespace for this library. You can do some basic configuration stuff by calling methods on its singleton.

Defined Under Namespace

Modules: Action, Emitter, EventLookup, Helpers, Notifier, Watcher Classes: Broker, Brokerage, Dispatcher, Event, IdentifierCollisionError, IdentifierGenerationError, InvalidIdentifierError, InvalidPayloadError, Synchronous

Constant Summary collapse

VERSION =
'1.1.0'

Class Method Summary collapse

Class Method Details

.brokerClass

Returns the currently enabled broker class.

Returns:

  • (Class)

    the currently enabled broker class



39
40
41
# File 'lib/emittance.rb', line 39

def broker
  Emittance::Brokerage.broker
end

.disable!Object

Disable eventing process-wide



29
30
31
# File 'lib/emittance.rb', line 29

def disable!
  Emittance::Brokerage.disable!
end

.dispatcherClass

Returns the dispatcher attached to the currently enabled broker.

Returns:

  • (Class)

    the dispatcher attached to the currently enabled broker



44
45
46
# File 'lib/emittance.rb', line 44

def dispatcher
  broker.dispatcher
end

.enable!Object

Enable eventing process-wide



24
25
26
# File 'lib/emittance.rb', line 24

def enable!
  Emittance::Brokerage.enable!
end

.enabled?Boolean

Returns true if eventing is enabled, false otherwise.

Returns:

  • (Boolean)

    true if eventing is enabled, false otherwise



34
35
36
# File 'lib/emittance.rb', line 34

def enabled?
  Emittance::Brokerage.enabled?
end

.use_broker(identifier) ⇒ Object

Parameters:

  • the (identifier)

    identifier that can be used to identify the broker you wish to use



49
50
51
# File 'lib/emittance.rb', line 49

def use_broker(identifier)
  Emittance::Brokerage.use_broker identifier
end