AsyncSourceAsyncStopCause

class Cause

Represents the source of the stop operation.

Definitions

def self.backtrace

Signature

returns Array(Thread::Backtrace::Location)

The backtrace of the caller.

Implementation

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

def self.backtrace

Signature

returns Array(String)

The backtrace of the caller.

Implementation

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

def self.for(message = "Task was stopped")

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

Signature

parameter message String

The error message.

returns Cause

The cause of the stop operation.

Implementation

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

Discussion