Sha256: 23bf9d71f81483979bac3da0ff96516f8120854bef0d4e3bf5e2ecbe3e4c8c06
Contents?: true
Size: 639 Bytes
Versions: 13
Compression:
Stored size: 639 Bytes
Contents
module Celluloid # Responses to calls class Response attr_reader :call, :value def initialize(call, value) @call, @value = call, value end def dispatch @call.task.resume self end end # Call completed successfully class SuccessResponse < Response; end # Call was aborted due to caller error class ErrorResponse < Response def value if super.is_a? AbortError # Aborts are caused by caller error, so ensure they capture the # caller's backtrace instead of the receiver's raise super.cause.exception else raise super end end end end
Version data entries
13 entries across 13 versions & 1 rubygems