Class: ShareDataWatcher::Type::Watch
- Defined in:
- lib/share-data-watcher/type/watch.rb
Overview
Watch Type Watch key changes
Constant Summary collapse
- DEFAULT_RETRY_INTERVAL =
30
Instance Attribute Summary collapse
-
#after_change ⇒ Object
readonly
Returns the value of attribute after_change.
-
#retry_interval ⇒ Object
readonly
Returns the value of attribute retry_interval.
-
#start_revision ⇒ Object
readonly
Returns the value of attribute start_revision.
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
#get, #restart, #to_h, #valid?
Methods included from Loggable
Constructor Details
#initialize(endpoints, key, opt = {}) ⇒ Watch
17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/share-data-watcher/type/watch.rb', line 17 def initialize(endpoints, key, opt = {}) @retry_interval = opt[:retry_interval] || DEFAULT_RETRY_INTERVAL @after_change = opt[:after_change] || nil if after_change && !after_change.is_a?(Proc) raise ArgumentError, 'after_change must be proc' end @thread = nil super end |
Instance Attribute Details
#after_change ⇒ Object (readonly)
Returns the value of attribute after_change.
10 11 12 |
# File 'lib/share-data-watcher/type/watch.rb', line 10 def after_change @after_change end |
#retry_interval ⇒ Object (readonly)
Returns the value of attribute retry_interval.
9 10 11 |
# File 'lib/share-data-watcher/type/watch.rb', line 9 def retry_interval @retry_interval end |
#start_revision ⇒ Object (readonly)
Returns the value of attribute start_revision.
8 9 10 |
# File 'lib/share-data-watcher/type/watch.rb', line 8 def start_revision @start_revision end |
Instance Method Details
#shutdown ⇒ Object
29 30 31 32 |
# File 'lib/share-data-watcher/type/watch.rb', line 29 def shutdown @thread.exit super end |