-
-
Notifications
You must be signed in to change notification settings - Fork 280
/
shoryuken.rb
106 lines (100 loc) · 2.75 KB
/
shoryuken.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
require 'yaml'
require 'json'
require 'aws-sdk-core'
begin
require 'aws-sdk-sqs' unless defined?(Aws::SQS)
rescue LoadError
fail "AWS SDK 3 requires aws-sdk-sqs to be installed separately. Please add gem 'aws-sdk-sqs' to your Gemfile"
end
require 'time'
require 'concurrent'
require 'forwardable'
require 'shoryuken/version'
require 'shoryuken/core_ext'
require 'shoryuken/util'
require 'shoryuken/logging'
require 'shoryuken/environment_loader'
require 'shoryuken/queue'
require 'shoryuken/message'
require 'shoryuken/client'
require 'shoryuken/worker'
require 'shoryuken/worker/default_executor'
require 'shoryuken/worker/inline_executor'
require 'shoryuken/worker_registry'
require 'shoryuken/default_worker_registry'
require 'shoryuken/default_exception_handler'
require 'shoryuken/middleware/chain'
require 'shoryuken/middleware/server/auto_delete'
Shoryuken::Middleware::Server.autoload :AutoExtendVisibility, 'shoryuken/middleware/server/auto_extend_visibility'
require 'shoryuken/middleware/server/exponential_backoff_retry'
require 'shoryuken/middleware/server/timing'
require 'shoryuken/polling/base'
require 'shoryuken/polling/weighted_round_robin'
require 'shoryuken/polling/strict_priority'
require 'shoryuken/manager'
require 'shoryuken/launcher'
require 'shoryuken/processor'
require 'shoryuken/body_parser'
require 'shoryuken/fetcher'
require 'shoryuken/options'
module Shoryuken
extend SingleForwardable
def self.shoryuken_options
@_shoryuken_options ||= Shoryuken::Options.new
end
def self.healthy?
Shoryuken::Runner.instance.healthy?
end
def_delegators(
:shoryuken_options,
:active_job?,
:add_group,
:groups,
:add_queue,
:ungrouped_queues,
:worker_registry,
:worker_registry=,
:worker_executor,
:worker_executor=,
:launcher_executor,
:launcher_executor=,
:polling_strategy,
:start_callback,
:start_callback=,
:stop_callback,
:stop_callback=,
:active_job_queue_name_prefixing?,
:active_job_queue_name_prefixing=,
:sqs_client,
:sqs_client=,
:sqs_client_receive_message_opts,
:sqs_client_receive_message_opts=,
:exception_handlers,
:exception_handlers=,
:options,
:logger,
:register_worker,
:configure_server,
:server?,
:server_middleware,
:configure_client,
:client_middleware,
:default_worker_options,
:default_worker_options=,
:on_start,
:on_stop,
:on,
:cache_visibility_timeout?,
:cache_visibility_timeout=,
:reloader,
:reloader=,
:enable_reloading,
:enable_reloading=,
:delay
)
end
if Shoryuken.active_job?
require 'shoryuken/extensions/active_job_extensions'
require 'shoryuken/extensions/active_job_adapter'
require 'shoryuken/extensions/active_job_concurrent_send_adapter'
end