Module: Ballast
- Defined in:
- lib/ballast.rb,
lib/ballast/emoji.rb,
lib/ballast/errors.rb,
lib/ballast/version.rb,
lib/ballast/service.rb,
lib/ballast/configuration.rb,
lib/ballast/concerns/view.rb,
lib/ballast/ajax_response.rb,
lib/ballast/concerns/common.rb,
lib/ballast/request_domain_matcher.rb,
lib/ballast/concerns/ajax_handling.rb,
lib/ballast/concerns/errors_handling.rb,
lib/ballast/middlewares/default_host.rb
Overview
This file is part of the ballast gem. Copyright (C) 2013 and above Shogun shogun@cowtech.it. Licensed under the MIT license, which can be found at http://www.opensource.org/licenses/mit-license.php.
Defined Under Namespace
Modules: Concerns, Emoji, Errors, Middlewares, Version Classes: AjaxResponse, Configuration, RequestDomainMatcher, Service
Class Method Summary (collapse)
-
+ (Object) in_em_thread(start_reactor = false, &block)
If running under eventmachine, runs the block in a thread of its threadpool using EM::Synchrony, otherwise runs the block directly.
Class Method Details
+ (Object) in_em_thread(start_reactor = false, &block)
If running under eventmachine, runs the block in a thread of its threadpool using EM::Synchrony, otherwise runs the block directly.
37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/ballast.rb', line 37 def self.in_em_thread(start_reactor = false, &block) if EM.reactor_running? run_in_thread(&block) elsif start_reactor EM.synchrony do Ballast.in_em_thread(&block) EM.stop end else block.call end end |