File tree Expand file tree Collapse file tree 1 file changed +14
-12
lines changed Expand file tree Collapse file tree 1 file changed +14
-12
lines changed Original file line number Diff line number Diff line change @@ -187,18 +187,7 @@ class TimerTask < RubyExecutorService
187
187
# @see Concurrent::Dereferenceable# set_deref_options
188
188
def initialize ( opts = { } , &task )
189
189
raise ArgumentError . new ( 'no block given' ) unless block_given?
190
-
191
- super ( &:nil )
192
- init_mutex ( self )
193
- set_deref_options ( opts )
194
-
195
- self . execution_interval = opts [ :execution ] || opts [ :execution_interval ] || EXECUTION_INTERVAL
196
- self . timeout_interval = opts [ :timeout ] || opts [ :timeout_interval ] || TIMEOUT_INTERVAL
197
- @run_now = opts [ :now ] || opts [ :run_now ]
198
- @executor = Concurrent ::SafeTaskExecutor . new ( task )
199
- @running = Concurrent ::AtomicBoolean . new ( false )
200
-
201
- self . observers = CopyOnNotifyObserverSet . new
190
+ super
202
191
end
203
192
204
193
# Is the executor running?
@@ -282,6 +271,19 @@ def timeout_interval=(value)
282
271
283
272
protected
284
273
274
+ def ns_initialize ( opts = { } , &task )
275
+ init_mutex ( self )
276
+ set_deref_options ( opts )
277
+
278
+ self . execution_interval = opts [ :execution ] || opts [ :execution_interval ] || EXECUTION_INTERVAL
279
+ self . timeout_interval = opts [ :timeout ] || opts [ :timeout_interval ] || TIMEOUT_INTERVAL
280
+ @run_now = opts [ :now ] || opts [ :run_now ]
281
+ @executor = Concurrent ::SafeTaskExecutor . new ( task )
282
+ @running = Concurrent ::AtomicBoolean . new ( false )
283
+
284
+ self . observers = CopyOnNotifyObserverSet . new
285
+ end
286
+
285
287
# @!visibility private
286
288
def shutdown_execution
287
289
@running . make_false
You can’t perform that action at this time.
0 commit comments