Module: EventStream

Extended by:
Forwardable
Defined in:
lib/event_stream.rb,
lib/event_stream/event.rb,
lib/event_stream/stream.rb,
lib/event_stream/version.rb,
lib/event_stream/registry.rb,
lib/event_stream/subscriber.rb,
lib/event_stream/test_helper.rb,
lib/event_stream/subscriber_dsl.rb

Defined Under Namespace

Modules: Assertions, SubscriberDSL, TestEventStream Classes: Event, Registry, Stream, Subscriber

Constant Summary collapse

VERSION =
"1.0.0"

Class Method Summary collapse

Class Method Details

.[](stream_name) ⇒ Stream

Returns the stream for a stream name from the stream registry.

Parameters:

  • stream_name (Symbol)

Returns:



15
16
17
# File 'lib/event_stream.rb', line 15

def [](stream_name)
  Registry.lookup(stream_name)
end

.default_streamStream

The default event stream

Returns:



28
29
30
# File 'lib/event_stream.rb', line 28

def default_stream
  self[:default]
end

.register_stream(stream_name, stream) ⇒ Object

Registers a stream, associating it with a specific stream name

Parameters:

  • stream_name (Symbol)
  • stream (Stream)


22
23
24
# File 'lib/event_stream.rb', line 22

def register_stream(stream_name, stream)
  Registry.register(stream_name, stream)
end