Class: Cramp::Abstract

Inherits:
Object
  • Object
show all
Includes:
Callbacks, FiberPool
Defined in:
lib/cramp/abstract.rb

Direct Known Subclasses

Action

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Callbacks

#before_start, #callback_wrapper, #on_finish, #on_start

Constructor Details

#initialize(env) ⇒ Abstract

Returns a new instance of Abstract.



17
18
19
20
21
22
# File 'lib/cramp/abstract.rb', line 17

def initialize(env)
  @env = env
  @finished = false

  @_state = :init
end

Class Method Details

.call(env) ⇒ Object



12
13
14
# File 'lib/cramp/abstract.rb', line 12

def call(env)
  new(env).process
end

Instance Method Details

#processObject



24
25
26
27
# File 'lib/cramp/abstract.rb', line 24

def process
  EM.next_tick { before_start }
  throw :async
end