totoro 0.2.3 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/TODO +4 -0
- data/docker-compose.yml +1 -1
- data/lib/totoro/base_queue.rb +1 -0
- data/lib/totoro/base_worker.rb +1 -0
- data/lib/totoro/version.rb +1 -1
- data/pkg/totoro-0.2.3.gem +0 -0
- data/test/totoro_test/Gemfile.lock +2 -2
- data/test/totoro_test/app/models/worker/example_queue.rb +10 -0
- data/test/totoro_test/config/environments/development.rb +1 -1
- data/test/totoro_test/config/environments/production.rb +0 -1
- data/test/totoro_test/config/environments/test.rb +0 -1
- data/test/totoro_test/config/initializers/totoro.rb +1 -0
- data/test/totoro_test/config/totoro.yml +31 -0
- data/test/totoro_test/log/development.log +1 -0
- data/test/totoro_test/log/production.log +1 -0
- metadata +9 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6bcf67a54e3430d56f804525a3ee9731008b194367f25fed929c47580a2c03f1
|
4
|
+
data.tar.gz: ff0ae95316f329cbbc9871c4e354c32764a6c0a1d15c791272b030798d7ce42e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 622ef851054883c47902772edc0f0e15ae8d7f55c0c81a4118cda3f8d1840ce4fcd69d043da6c804590438227914fc5ca54ac5799d32f86a82c3d5d73b1905f9
|
7
|
+
data.tar.gz: 3c7e47eaf077234773f36f860b04411ac05f87e5ca548ac24698a65b3d5357ed9fe0efd5d89408601d78344b617b984a7b72e964b357aaabb1e173186d578e2d
|
data/docker-compose.yml
CHANGED
data/lib/totoro/base_queue.rb
CHANGED
@@ -23,6 +23,7 @@ module Totoro
|
|
23
23
|
|
24
24
|
# enqueue = publish to direct exchange
|
25
25
|
def enqueue(id, payload)
|
26
|
+
Rails.logger.info "#{queue.name} send message"
|
26
27
|
queue = channel.queue(*config.queue(id))
|
27
28
|
payload = JSON.dump payload
|
28
29
|
exchange.publish(payload, routing_key: queue.name)
|
data/lib/totoro/base_worker.rb
CHANGED
@@ -19,6 +19,7 @@ module Totoro
|
|
19
19
|
|
20
20
|
def execute
|
21
21
|
@queue_class.subscribe(@queue_name) do |delivery_info, metadata, payload|
|
22
|
+
Rails.logger.info "#{@queue_name} received message"
|
22
23
|
payload_hash = JSON.parse(payload).with_indifferent_access
|
23
24
|
process(payload_hash, metadata, delivery_info)
|
24
25
|
end
|
data/lib/totoro/version.rb
CHANGED
Binary file
|
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: /totoro
|
3
3
|
specs:
|
4
|
-
totoro (0.
|
4
|
+
totoro (0.2.3)
|
5
5
|
bunny (~> 2.10)
|
6
6
|
|
7
7
|
GEM
|
@@ -47,7 +47,7 @@ GEM
|
|
47
47
|
amq-protocol (2.3.0)
|
48
48
|
arel (8.0.0)
|
49
49
|
builder (3.2.3)
|
50
|
-
bunny (2.
|
50
|
+
bunny (2.11.0)
|
51
51
|
amq-protocol (~> 2.3.0)
|
52
52
|
byebug (10.0.2)
|
53
53
|
concurrent-ruby (1.0.5)
|
@@ -36,7 +36,7 @@ Rails.application.configure do
|
|
36
36
|
|
37
37
|
# Raise an error on page load if there are pending migrations.
|
38
38
|
config.active_record.migration_error = :page_load
|
39
|
-
|
39
|
+
config.logger = Logger.new(STDOUT)
|
40
40
|
|
41
41
|
# Raises error for missing translations
|
42
42
|
# config.action_view.raise_on_missing_translations = true
|
@@ -71,7 +71,6 @@ Rails.application.configure do
|
|
71
71
|
# Use a different logger for distributed setups.
|
72
72
|
# require 'syslog/logger'
|
73
73
|
# config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name')
|
74
|
-
|
75
74
|
if ENV["RAILS_LOG_TO_STDOUT"].present?
|
76
75
|
logger = ActiveSupport::Logger.new(STDOUT)
|
77
76
|
logger.formatter = config.log_formatter
|
@@ -17,7 +17,6 @@ Rails.application.configure do
|
|
17
17
|
config.public_file_server.headers = {
|
18
18
|
'Cache-Control' => "public, max-age=#{1.hour.seconds.to_i}"
|
19
19
|
}
|
20
|
-
|
21
20
|
# Show full error reports and disable caching.
|
22
21
|
config.consider_all_requests_local = true
|
23
22
|
config.action_controller.perform_caching = false
|
@@ -0,0 +1 @@
|
|
1
|
+
Totoro::Initializer.new.execute
|
@@ -0,0 +1,31 @@
|
|
1
|
+
default: &default
|
2
|
+
default:
|
3
|
+
connect:
|
4
|
+
host: rabbitmq
|
5
|
+
port: 5672
|
6
|
+
user: app
|
7
|
+
pass: app
|
8
|
+
queue:
|
9
|
+
example_queue:
|
10
|
+
name: real.queue.name
|
11
|
+
durable: true
|
12
|
+
|
13
|
+
custom:
|
14
|
+
connect:
|
15
|
+
host: rabbitmq
|
16
|
+
port: 5672
|
17
|
+
user: app
|
18
|
+
pass: app
|
19
|
+
queue:
|
20
|
+
custom_queue:
|
21
|
+
name: custom.queue.name
|
22
|
+
durable: true
|
23
|
+
|
24
|
+
development:
|
25
|
+
<<: *default
|
26
|
+
|
27
|
+
test:
|
28
|
+
<<: *default
|
29
|
+
|
30
|
+
production:
|
31
|
+
<<: *default
|
@@ -0,0 +1 @@
|
|
1
|
+
huishu
|
@@ -0,0 +1 @@
|
|
1
|
+
E, [2018-07-23T04:24:19.172785 #25] ERROR -- : huishu
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: totoro
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ShuHui18
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-07-
|
11
|
+
date: 2018-07-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bunny
|
@@ -81,6 +81,7 @@ files:
|
|
81
81
|
- LICENSE.txt
|
82
82
|
- README.md
|
83
83
|
- Rakefile
|
84
|
+
- TODO
|
84
85
|
- bin/console
|
85
86
|
- bin/setup
|
86
87
|
- bin/totoro
|
@@ -98,6 +99,7 @@ files:
|
|
98
99
|
- lib/totoro/initializer.rb
|
99
100
|
- lib/totoro/version.rb
|
100
101
|
- pkg/totoro-0.2.2.gem
|
102
|
+
- pkg/totoro-0.2.3.gem
|
101
103
|
- spec/spec_helper.rb
|
102
104
|
- spec/totoro_spec.rb
|
103
105
|
- test/totoro_test/Gemfile
|
@@ -110,6 +112,7 @@ files:
|
|
110
112
|
- test/totoro_test/app/jobs/application_job.rb
|
111
113
|
- test/totoro_test/app/mailers/application_mailer.rb
|
112
114
|
- test/totoro_test/app/models/application_record.rb
|
115
|
+
- test/totoro_test/app/models/worker/example_queue.rb
|
113
116
|
- test/totoro_test/app/views/layouts/mailer.html.erb
|
114
117
|
- test/totoro_test/app/views/layouts/mailer.text.erb
|
115
118
|
- test/totoro_test/bin/bundle
|
@@ -133,13 +136,17 @@ files:
|
|
133
136
|
- test/totoro_test/config/initializers/filter_parameter_logging.rb
|
134
137
|
- test/totoro_test/config/initializers/inflections.rb
|
135
138
|
- test/totoro_test/config/initializers/mime_types.rb
|
139
|
+
- test/totoro_test/config/initializers/totoro.rb
|
136
140
|
- test/totoro_test/config/initializers/wrap_parameters.rb
|
137
141
|
- test/totoro_test/config/locales/en.yml
|
138
142
|
- test/totoro_test/config/puma.rb
|
139
143
|
- test/totoro_test/config/routes.rb
|
140
144
|
- test/totoro_test/config/secrets.yml
|
141
145
|
- test/totoro_test/config/spring.rb
|
146
|
+
- test/totoro_test/config/totoro.yml
|
142
147
|
- test/totoro_test/db/seeds.rb
|
148
|
+
- test/totoro_test/log/development.log
|
149
|
+
- test/totoro_test/log/production.log
|
143
150
|
- test/totoro_test/public/robots.txt
|
144
151
|
- test/totoro_test/test/test_helper.rb
|
145
152
|
- totoro.gemspec
|