lib/libvirt_async/util.rb in libvirt_async-0.1.0 vs lib/libvirt_async/util.rb in libvirt_async-0.1.1
- old
+ new
@@ -1,9 +1,10 @@
module LibvirtAsync
module Util
- def create_task(&block)
- Async::Task.new(Async::Task.current.reactor, &block)
+ def create_task(parent = nil, &block)
+ parent = Async::Task.current? if parent == :current
+ Async::Task.new(Async::Task.current.reactor, parent, &block)
end
module_function :create_task
end