Class: RubyEventStore::CLI::Commands::Watch

Inherits:
Base
  • Object
show all
Defined in:
lib/ruby_event_store/cli/commands/watch.rb

Instance Method Summary collapse

Instance Method Details

#call(namespace: nil, since: nil, limit:, interval:) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/ruby_event_store/cli/commands/watch.rb', line 17

def call(namespace: nil, since: nil, limit:, interval:, **)
  started_at = since ? Time.parse(since) : Time.now
  namespaces = namespace&.split(",")&.map(&:strip)
  watch(since: started_at, namespaces: namespaces, limit: limit.to_i, interval: interval.to_i)
rescue Interrupt
  show_cursor
  exit 0
rescue => e
  show_cursor
  warn e.message
  exit 1
end