Module: Larynx::CallbacksWithAsync

Included in:
Field
Defined in:
lib/larynx/callbacks_with_async.rb

Overview

Allows you to set the :async flag on the back to the callback in with EM.defer method. Its useful for long running tasks like database calls.

Defined Under Namespace

Modules: ClassMethods, InstanceMethods

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object



5
6
7
8
9
10
11
12
# File 'lib/larynx/callbacks_with_async.rb', line 5

def self.included(base)
  base.extend ClassMethods
  base.cattr_accessor :callback_options
  base.callback_options = {}
  base.class_eval do
    include InstanceMethods
  end
end