class Async::Task

def make_fiber(&block)

def make_fiber(&block)
	Fiber.new do |*args|
		set!
		
		begin
			@result = yield(self, *args)
			@status = :complete
			# logger.debug("Task #{self} completed normally.")
		rescue Stop
			stop!
		rescue StandardError => error
			fail!(error, false)
		rescue Exception => exception
			fail!(exception, true)
		ensure
			# logger.debug("Task #{self} closing: #{$!}")
			finish!
		end
	end
end