railway-ipc 0.1.7 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (54) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +4 -3
  3. data/CHANGELOG.md +67 -0
  4. data/Gemfile +2 -2
  5. data/README.md +1 -1
  6. data/Rakefile +10 -4
  7. data/bin/console +3 -3
  8. data/bin/rspec +29 -0
  9. data/bin/rubocop +29 -0
  10. data/lib/railway_ipc.rb +9 -11
  11. data/lib/railway_ipc/Rakefile +2 -0
  12. data/lib/railway_ipc/consumer/consumer.rb +33 -73
  13. data/lib/railway_ipc/consumer/process_incoming_message.rb +111 -0
  14. data/lib/railway_ipc/errors.rb +9 -1
  15. data/lib/railway_ipc/handler.rb +17 -3
  16. data/lib/railway_ipc/handler_store.rb +5 -2
  17. data/lib/railway_ipc/incoming_message.rb +51 -0
  18. data/lib/railway_ipc/logger.rb +44 -26
  19. data/lib/railway_ipc/models/consumed_message.rb +40 -35
  20. data/lib/railway_ipc/models/published_message.rb +11 -9
  21. data/lib/railway_ipc/publisher.rb +67 -16
  22. data/lib/railway_ipc/rabbitmq/adapter.rb +23 -15
  23. data/lib/railway_ipc/rabbitmq/payload.rb +9 -4
  24. data/lib/railway_ipc/railtie.rb +2 -0
  25. data/lib/railway_ipc/responder.rb +10 -3
  26. data/lib/railway_ipc/response.rb +4 -1
  27. data/lib/railway_ipc/rpc/client/client.rb +43 -18
  28. data/lib/railway_ipc/rpc/client/client_response_handlers.rb +2 -0
  29. data/lib/railway_ipc/rpc/client/errors/timeout_error.rb +2 -0
  30. data/lib/railway_ipc/rpc/concerns/error_adapter_configurable.rb +2 -0
  31. data/lib/railway_ipc/rpc/concerns/message_observation_configurable.rb +2 -0
  32. data/lib/railway_ipc/rpc/concerns/publish_location_configurable.rb +2 -0
  33. data/lib/railway_ipc/rpc/rpc.rb +2 -0
  34. data/lib/railway_ipc/rpc/server/server.rb +25 -7
  35. data/lib/railway_ipc/rpc/server/server_response_handlers.rb +2 -0
  36. data/lib/railway_ipc/tasks/generate_migrations.rake +16 -16
  37. data/lib/railway_ipc/tasks/start_consumers.rake +3 -1
  38. data/lib/railway_ipc/tasks/start_servers.rake +3 -1
  39. data/lib/railway_ipc/unhandled_message_error.rb +2 -0
  40. data/lib/railway_ipc/unknown_message.pb.rb +18 -0
  41. data/lib/railway_ipc/version.rb +3 -1
  42. data/priv/migrations/add_railway_ipc_consumed_messages.rb +5 -3
  43. data/priv/migrations/add_railway_ipc_published_messages.rb +3 -1
  44. data/railway_ipc.gemspec +34 -30
  45. metadata +62 -64
  46. data/.rspec +0 -3
  47. data/.travis.yml +0 -7
  48. data/CHANGELOG.MD +0 -7
  49. data/Gemfile.lock +0 -186
  50. data/lib/railway_ipc/base_message.pb.rb +0 -21
  51. data/lib/railway_ipc/consumer/consumer_response_handlers.rb +0 -14
  52. data/lib/railway_ipc/handler_manifest.rb +0 -10
  53. data/lib/railway_ipc/null_handler.rb +0 -7
  54. data/lib/railway_ipc/null_message.rb +0 -7
data/.rspec DELETED
@@ -1,3 +0,0 @@
1
- --format documentation
2
- --color
3
- --require spec_helper
@@ -1,7 +0,0 @@
1
- ---
2
- sudo: false
3
- language: ruby
4
- cache: bundler
5
- rvm:
6
- - 2.5.1
7
- before_install: gem install bundler -v 2.0.1
@@ -1,7 +0,0 @@
1
- # Changelog for v0.x
2
-
3
- ## v0.1.7 (2020-06-29)
4
-
5
- ### Enhancements
6
-
7
- - Correlation ID and message UUID are auto generated for messages for IDs are not passed in [#23](https://github.com/learn-co/railway_ipc_gem/pull/23)
@@ -1,186 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- railway-ipc (0.1.7)
5
- bunny (~> 2.2.0)
6
- sneakers (~> 2.3.5)
7
-
8
- GEM
9
- remote: https://rubygems.org/
10
- specs:
11
- actioncable (5.0.7.2)
12
- actionpack (= 5.0.7.2)
13
- nio4r (>= 1.2, < 3.0)
14
- websocket-driver (~> 0.6.1)
15
- actionmailer (5.0.7.2)
16
- actionpack (= 5.0.7.2)
17
- actionview (= 5.0.7.2)
18
- activejob (= 5.0.7.2)
19
- mail (~> 2.5, >= 2.5.4)
20
- rails-dom-testing (~> 2.0)
21
- actionpack (5.0.7.2)
22
- actionview (= 5.0.7.2)
23
- activesupport (= 5.0.7.2)
24
- rack (~> 2.0)
25
- rack-test (~> 0.6.3)
26
- rails-dom-testing (~> 2.0)
27
- rails-html-sanitizer (~> 1.0, >= 1.0.2)
28
- actionview (5.0.7.2)
29
- activesupport (= 5.0.7.2)
30
- builder (~> 3.1)
31
- erubis (~> 2.7.0)
32
- rails-dom-testing (~> 2.0)
33
- rails-html-sanitizer (~> 1.0, >= 1.0.3)
34
- activejob (5.0.7.2)
35
- activesupport (= 5.0.7.2)
36
- globalid (>= 0.3.6)
37
- activemodel (5.0.7.2)
38
- activesupport (= 5.0.7.2)
39
- activerecord (5.0.7.2)
40
- activemodel (= 5.0.7.2)
41
- activesupport (= 5.0.7.2)
42
- arel (~> 7.0)
43
- activesupport (5.0.7.2)
44
- concurrent-ruby (~> 1.0, >= 1.0.2)
45
- i18n (>= 0.7, < 2)
46
- minitest (~> 5.1)
47
- tzinfo (~> 1.1)
48
- amq-protocol (2.3.1)
49
- arel (7.1.4)
50
- builder (3.2.4)
51
- bunny (2.2.2)
52
- amq-protocol (>= 2.0.1)
53
- byebug (9.1.0)
54
- coderay (1.1.2)
55
- concurrent-ruby (1.1.5)
56
- crass (1.0.5)
57
- database_cleaner (1.7.0)
58
- diff-lcs (1.3)
59
- erubis (2.7.0)
60
- factory_bot (5.1.1)
61
- activesupport (>= 4.2.0)
62
- ffi (1.11.3)
63
- globalid (0.4.2)
64
- activesupport (>= 4.2.0)
65
- google-protobuf (3.9.2)
66
- i18n (1.7.0)
67
- concurrent-ruby (~> 1.0)
68
- listen (3.0.8)
69
- rb-fsevent (~> 0.9, >= 0.9.4)
70
- rb-inotify (~> 0.9, >= 0.9.7)
71
- loofah (2.4.0)
72
- crass (~> 1.0.2)
73
- nokogiri (>= 1.5.9)
74
- mail (2.7.1)
75
- mini_mime (>= 0.1.1)
76
- method_source (0.9.2)
77
- mini_mime (1.0.2)
78
- mini_portile2 (2.4.0)
79
- minitest (5.13.0)
80
- nio4r (2.5.2)
81
- nokogiri (1.10.7)
82
- mini_portile2 (~> 2.4.0)
83
- pg (0.21.0)
84
- pry (0.12.2)
85
- coderay (~> 1.1.0)
86
- method_source (~> 0.9.0)
87
- pry-byebug (3.4.2)
88
- byebug (~> 9.0)
89
- pry (~> 0.10)
90
- rack (2.0.7)
91
- rack-test (0.6.3)
92
- rack (>= 1.0)
93
- rails (5.0.7.2)
94
- actioncable (= 5.0.7.2)
95
- actionmailer (= 5.0.7.2)
96
- actionpack (= 5.0.7.2)
97
- actionview (= 5.0.7.2)
98
- activejob (= 5.0.7.2)
99
- activemodel (= 5.0.7.2)
100
- activerecord (= 5.0.7.2)
101
- activesupport (= 5.0.7.2)
102
- bundler (>= 1.3.0)
103
- railties (= 5.0.7.2)
104
- sprockets-rails (>= 2.0.0)
105
- rails-dom-testing (2.0.3)
106
- activesupport (>= 4.2.0)
107
- nokogiri (>= 1.6)
108
- rails-html-sanitizer (1.3.0)
109
- loofah (~> 2.3)
110
- railties (5.0.7.2)
111
- actionpack (= 5.0.7.2)
112
- activesupport (= 5.0.7.2)
113
- method_source
114
- rake (>= 0.8.7)
115
- thor (>= 0.18.1, < 2.0)
116
- rake (13.0.0)
117
- rb-fsevent (0.10.3)
118
- rb-inotify (0.10.0)
119
- ffi (~> 1.0)
120
- rspec (3.8.0)
121
- rspec-core (~> 3.8.0)
122
- rspec-expectations (~> 3.8.0)
123
- rspec-mocks (~> 3.8.0)
124
- rspec-core (3.8.2)
125
- rspec-support (~> 3.8.0)
126
- rspec-expectations (3.8.4)
127
- diff-lcs (>= 1.2.0, < 2.0)
128
- rspec-support (~> 3.8.0)
129
- rspec-mocks (3.8.1)
130
- diff-lcs (>= 1.2.0, < 2.0)
131
- rspec-support (~> 3.8.0)
132
- rspec-rails (3.8.3)
133
- actionpack (>= 3.0)
134
- activesupport (>= 3.0)
135
- railties (>= 3.0)
136
- rspec-core (~> 3.8.0)
137
- rspec-expectations (~> 3.8.0)
138
- rspec-mocks (~> 3.8.0)
139
- rspec-support (~> 3.8.0)
140
- rspec-support (3.8.2)
141
- serverengine (1.5.11)
142
- sigdump (~> 0.2.2)
143
- shoulda-matchers (4.2.0)
144
- activesupport (>= 4.2.0)
145
- sigdump (0.2.4)
146
- sneakers (2.3.5)
147
- bunny (~> 2.2.0)
148
- serverengine (~> 1.5.11)
149
- thor
150
- thread (~> 0.1.7)
151
- sprockets (4.0.0)
152
- concurrent-ruby (~> 1.0)
153
- rack (> 1, < 3)
154
- sprockets-rails (3.2.1)
155
- actionpack (>= 4.0)
156
- activesupport (>= 4.0)
157
- sprockets (>= 3.0.0)
158
- thor (0.20.3)
159
- thread (0.1.7)
160
- thread_safe (0.3.6)
161
- tzinfo (1.2.5)
162
- thread_safe (~> 0.1)
163
- websocket-driver (0.6.5)
164
- websocket-extensions (>= 0.1.0)
165
- websocket-extensions (0.1.4)
166
-
167
- PLATFORMS
168
- ruby
169
-
170
- DEPENDENCIES
171
- bundler (= 2.0.1)
172
- database_cleaner (~> 1.7)
173
- factory_bot (~> 5.1)
174
- google-protobuf (~> 3.9)
175
- listen (~> 3.0.5)
176
- pg (~> 0.18)
177
- pry-byebug (= 3.4.2)
178
- rails (~> 5.0.7)
179
- railway-ipc!
180
- rake (>= 10.0.0)
181
- rspec (~> 3.0)
182
- rspec-rails
183
- shoulda-matchers (~> 4.2)
184
-
185
- BUNDLED WITH
186
- 2.0.1
@@ -1,21 +0,0 @@
1
- # Generated by the protocol buffer compiler. DO NOT EDIT!
2
- # source: lib/src/events/base_message.proto
3
-
4
- require 'google/protobuf'
5
-
6
- Google::Protobuf::DescriptorPool.generated_pool.build do
7
- add_message "railway_ipc.BaseMessage" do
8
- optional :user_uuid, :string, 1
9
- optional :correlation_id, :string, 2
10
- optional :uuid, :string, 3
11
- map :context, :string, :string, 4
12
- optional :data, :message, 5, "railway_ipc.BaseMessage.Data"
13
- end
14
- add_message "railway_ipc.BaseMessage.Data" do
15
- end
16
- end
17
-
18
- module RailwayIpc
19
- BaseMessage = Google::Protobuf::DescriptorPool.generated_pool.lookup("railway_ipc.BaseMessage").msgclass
20
- BaseMessage::Data = Google::Protobuf::DescriptorPool.generated_pool.lookup("railway_ipc.BaseMessage.Data").msgclass
21
- end
@@ -1,14 +0,0 @@
1
- require 'railway_ipc/handler_store'
2
- module RailwayIpc
3
- class ConsumerResponseHandlers
4
- include Singleton
5
- extend Forwardable
6
- def_delegators :handler_store, :registered, :register, :get
7
-
8
- private
9
-
10
- def handler_store
11
- @handler_store ||= RailwayIpc::HandlerStore.new
12
- end
13
- end
14
- end
@@ -1,10 +0,0 @@
1
- module RailwayIpc
2
- class HandlerManifest
3
- attr_reader :message, :handler
4
-
5
- def initialize(message:, handler:)
6
- @message = message
7
- @handler = handler
8
- end
9
- end
10
- end
@@ -1,7 +0,0 @@
1
- module RailwayIpc
2
- class NullHandler < RailwayIpc::Handler
3
- def handle(message)
4
- nil
5
- end
6
- end
7
- end
@@ -1,7 +0,0 @@
1
- module RailwayIpc
2
- class NullMessage
3
- def self.decode(_message)
4
- self.new
5
- end
6
- end
7
- end