Class: EventSourcery::EventStore::SignalHandlingSubscriptionMaster

Inherits:
Object
  • Object
show all
Defined in:
lib/event_sourcery/event_store/signal_handling_subscription_master.rb

Overview

Manages shutdown signals and facilitate graceful shutdowns of subscriptions.

See Also:

Instance Method Summary collapse

Constructor Details

#initializeSignalHandlingSubscriptionMaster

Returns a new instance of SignalHandlingSubscriptionMaster.



7
8
9
10
# File 'lib/event_sourcery/event_store/signal_handling_subscription_master.rb', line 7

def initialize
  @shutdown_requested = false
  setup_graceful_shutdown
end

Instance Method Details

#shutdown_if_requestedObject

If a shutdown has been requested through a ‘TERM` or `INT` signal, this will throw a `:stop` (generally) causing a Subscription to stop listening for events.



16
17
18
# File 'lib/event_sourcery/event_store/signal_handling_subscription_master.rb', line 16

def shutdown_if_requested
  throw :stop if @shutdown_requested
end