Sha256: d81395e0e31f2d4810cf632d6a489f54f9270f064673f9f6ddf8d3c5b78a2fca
Contents?: true
Size: 580 Bytes
Versions: 27
Compression:
Stored size: 580 Bytes
Contents
module Eventboss # SafeThread includes thread handling with automatic error reporting module SafeThread def safe_thread(name) Thread.new do begin Thread.current[:ah_eventboss_label] = name yield rescue Exception => exception handle_exception(exception, name: name) raise exception end end end def handle_exception(exception, context) context.freeze Eventboss.configuration.error_handlers.each do |handler| handler.call(exception, context) end end end end
Version data entries
27 entries across 27 versions & 1 rubygems