Module: LambdaPunch
- Extended by:
- LambdaPunch
- Included in:
- LambdaPunch
- Defined in:
- lib/lambda_punch.rb,
lib/lambda_punch/api.rb,
lib/lambda_punch/error.rb,
lib/lambda_punch/queue.rb,
lib/lambda_punch/logger.rb,
lib/lambda_punch/server.rb,
lib/lambda_punch/worker.rb,
lib/lambda_punch/railtie.rb,
lib/lambda_punch/version.rb,
lib/lambda_punch/notifier.rb
Defined Under Namespace
Classes: Api, Error, EventTypeError, Logger, Notifier, Queue, Railtie, Server, Worker
Constant Summary
collapse
- VERSION =
"1.1.4"
Instance Method Summary
collapse
Instance Method Details
#error_handler ⇒ Object
51
52
53
54
55
56
|
# File 'lib/lambda_punch.rb', line 51
def error_handler
@error_handler ||= lambda do |e|
logger.error "Queue#call::error => #{e.message}"
logger.error e.backtrace[0..10].join("\n")
end
end
|
#error_handler=(func) ⇒ Object
58
59
60
|
# File 'lib/lambda_punch.rb', line 58
def error_handler=(func)
@error_handler = func
end
|
#handled!(context) ⇒ Object
47
48
49
|
# File 'lib/lambda_punch.rb', line 47
def handled!(context)
Notifier.handled!(context)
end
|
#logger ⇒ Object
43
44
45
|
# File 'lib/lambda_punch.rb', line 43
def logger
@logger ||= Logger.new.logger
end
|
#loop ⇒ Object
31
32
33
|
# File 'lib/lambda_punch.rb', line 31
def loop
Api.loop
end
|
#push(&block) ⇒ Object
23
24
25
|
# File 'lib/lambda_punch.rb', line 23
def push(&block)
Queue.push(block)
end
|
#register! ⇒ Object
27
28
29
|
# File 'lib/lambda_punch.rb', line 27
def register!
Api.register!
end
|
#start_server! ⇒ Object
35
36
37
|
# File 'lib/lambda_punch.rb', line 35
def start_server!
Server.start!
end
|
#start_worker! ⇒ Object
39
40
41
|
# File 'lib/lambda_punch.rb', line 39
def start_worker!
Worker.start!
end
|
#tmp_file ⇒ Object
62
63
64
|
# File 'lib/lambda_punch.rb', line 62
def tmp_file
Notifier.tmp_file
end
|