Class: EventSourcery::EventStore::SignalHandlingSubscriptionMaster
- Inherits:
-
Object
- Object
- EventSourcery::EventStore::SignalHandlingSubscriptionMaster
- Defined in:
- lib/event_sourcery/event_store/signal_handling_subscription_master.rb
Overview
Manages shutdown signals and facilitate graceful shutdowns of subscriptions.
Instance Method Summary collapse
-
#initialize ⇒ SignalHandlingSubscriptionMaster
constructor
A new instance of SignalHandlingSubscriptionMaster.
-
#shutdown_if_requested ⇒ Object
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.
Constructor Details
#initialize ⇒ SignalHandlingSubscriptionMaster
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_requested ⇒ Object
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 |