lib/legion/extensions/actors/once.rb in legionio-0.4.3 vs lib/legion/extensions/actors/once.rb in legionio-1.2.0
- old
+ new
@@ -5,11 +5,11 @@
module Actors
class Once
include Legion::Extensions::Actors::Base
def initialize
- return if disabled?
+ return unless enabled?
if respond_to? :functions
functions.each do
function
@task = Concurrent::ScheduledTask.execute(delay) do
@@ -28,10 +28,10 @@
def delay
1.0
end
def cancel
- return if disabled?
+ return unless enabled?
@task.cancel unless @task.cancelled?
end
end
end