Exception: Async::Cancel::Cause

Inherits:
Exception
  • Object
show all
Defined in:
lib/async/cancel.rb

Overview

Represents the source of the cancel operation.

Class Method Summary collapse

Class Method Details

.backtraceObject



13
14
15
# File 'lib/async/cancel.rb', line 13

def self.backtrace
	caller_locations(2..-1)
end

.for(message = "Task was cancelled!") ⇒ Object

Create a new cause of the cancel operation, with the given message.



27
28
29
30
31
# File 'lib/async/cancel.rb', line 27

def self.for(message = "Task was cancelled!")
	instance = self.new(message)
	instance.set_backtrace(self.backtrace)
	return instance
end