strum-pipeline 0.1.1 → 0.1.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '08c02b288609dbe7104951827793f553e9f81854207c0ff6cac3b39f3d71aad5'
4
- data.tar.gz: 900b840bf7dfa13769abfb7ba24d9dc7b005d446bec85a0105b746739354e0df
3
+ metadata.gz: 8ac1b3478f30c77e62d387e17ced22c4048c34aac1eee58efc8f2c548731805a
4
+ data.tar.gz: 38b9f14dd2a05696fd03b5bbac02c80dd960c4a3dde616fed59eea571ad6fd67
5
5
  SHA512:
6
- metadata.gz: 95203efc56f92da0cf057ca104832c0b92286faf3758014b5d3901e081e3f758e23fc10d47b88f607af20f40eb68944a35ba4d0ad987e4c0fcb7c76d6ce4902c
7
- data.tar.gz: a80758e037e0e244fcb46a03f28265c4711d78431026df9ea4b6f19cb9b8e3e8ec5129f85bd53bf56ad7fc06c305e920f243df347c451fd43ab933db1600dad6
6
+ metadata.gz: 9194dada8a068cb205faaf02b4c933f950b35fa482c5689d7de9f5979a471f6cb6cd457c85724864891e2e93f727d163c1ff89a5793f39796de3378b232a5035
7
+ data.tar.gz: 5b494e3e77d6ee2dcf8d274f78961f8e72b48048cc5b80ad73d6e89ab90a5c7161305ff49b3a27106da3271fdc016c20b0f3686f629d60f2054eba1f6576196e
data/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
  # Changelog
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ## [0.1.2] - 2021-07-01
6
+ ### Added
7
+ - Redis connection using env var or config by [@serhiy.nazarov].
8
+
5
9
  ## [0.1.1] - 2021-06-02
6
10
  ### Fixed
7
11
  - custom handlers for resource name with `-` by [@anton.klyzhka].
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- strum-pipeline (0.1.1)
4
+ strum-pipeline (0.1.2)
5
5
  bunny (~> 2.15)
6
6
  connection_pool (~> 2.2)
7
7
  dry-configurable (~> 0.11)
@@ -17,10 +17,10 @@ GEM
17
17
  specs:
18
18
  amq-protocol (2.3.2)
19
19
  ast (2.4.2)
20
- bunny (2.18.0)
20
+ bunny (2.19.0)
21
21
  amq-protocol (~> 2.3, >= 2.3.1)
22
22
  sorted_set (~> 1, >= 1.0.2)
23
- concurrent-ruby (1.1.8)
23
+ concurrent-ruby (1.1.9)
24
24
  connection_pool (2.2.5)
25
25
  debase (0.2.4.1)
26
26
  debase-ruby_core_source (>= 0.10.2)
@@ -29,19 +29,19 @@ GEM
29
29
  dry-configurable (0.12.1)
30
30
  concurrent-ruby (~> 1.0)
31
31
  dry-core (~> 0.5, >= 0.5.0)
32
- dry-core (0.5.0)
32
+ dry-core (0.6.0)
33
33
  concurrent-ruby (~> 1.0)
34
34
  dry-inflector (0.2.0)
35
35
  json (2.5.1)
36
36
  parallel (1.20.1)
37
- parser (3.0.1.1)
37
+ parser (3.0.1.0)
38
38
  ast (~> 2.4.1)
39
39
  rainbow (3.0.0)
40
40
  rake (12.3.3)
41
41
  rbtree (0.4.4)
42
- redis (4.2.5)
43
- redis-objects (1.5.0)
44
- redis (~> 4.0)
42
+ redis (4.3.1)
43
+ redis-objects (1.5.1)
44
+ redis (~> 4.2)
45
45
  regexp_parser (2.1.1)
46
46
  rexml (3.2.5)
47
47
  rspec (3.10.0)
@@ -85,10 +85,10 @@ GEM
85
85
  sorted_set (1.0.3)
86
86
  rbtree
87
87
  set (~> 1.0)
88
- strum-esb (0.1.1)
88
+ strum-esb (0.1.2)
89
89
  bunny (~> 2.15)
90
90
  connection_pool (~> 2.2.2)
91
- dry-configurable (~> 0.12)
91
+ dry-configurable (~> 0.12.1)
92
92
  json (~> 2.3)
93
93
  sneakers (~> 2.12)
94
94
  thor (1.1.0)
data/README.md CHANGED
@@ -47,6 +47,15 @@ require "strum/pipeline"
47
47
  class DemoPipeline
48
48
  include Strum::Pipeline
49
49
 
50
+ # changing default exchangers
51
+ Strum::Esb.config.info_exchange = "demo.info"
52
+ Strum::Esb.config.event_exchange = "demo.events"
53
+ Strum::Esb.config.action_exchange = "demo.actions"
54
+ Strum::Esb.config.notice_exchange = "demo.notice"
55
+
56
+ # changing default redis connection
57
+ Strum::Pipeline.config.redis_connection = { url: ENV.fetch("DEMO_REDIS_URL") }
58
+
50
59
  ttl 60
51
60
  init :event, "identity/create"
52
61
  init :event, "identity/update"
@@ -79,3 +88,10 @@ r = Sneakers::Runner.new([DemoPipeline])
79
88
  r.run
80
89
  ```
81
90
 
91
+ Also Redis connection can be set up by env var:
92
+ ```
93
+ PIPELINE_REDIS_HOST=127.0.0.1
94
+ PIPELINE_REDIS_PORT=6379
95
+ PIPELINE_REDIS_DB=0
96
+ ```
97
+
@@ -1,6 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "strum/pipeline/version"
4
+ require "redis/objects"
5
+ require 'connection_pool'
4
6
  require "strum/esb"
5
7
  require "strum/pipeline/storage"
6
8
  require "dry/configurable"
@@ -11,11 +13,15 @@ module Strum
11
13
  extend Dry::Configurable
12
14
 
13
15
  setting :ttl, 15 * 60 # default ttl is 15 mins
14
- setting :redis_connection, { host: "localhost", port: "6379" }
15
- setting :redis_connection_pool
16
+ setting :redis_connection, {
17
+ host: ENV.fetch("PIPELINE_REDIS_HOST", "localhost"),
18
+ port: ENV.fetch("PIPELINE_REDIS_PORT", "6379"),
19
+ db: ENV.fetch("PIPELINE_REDIS_DB", "0")
20
+ }
21
+ # setting :redis_connection_pool
16
22
 
17
23
  Strum::Esb.config.after_fork_hooks << proc do
18
- Strum::Pipeline.config.redis_connection_pool = ConnectionPool.new(size: 5, timeout: 5) do
24
+ Redis::Objects.redis = ConnectionPool.new(size: 5, timeout: 5) do
19
25
  Redis.new(Strum::Pipeline.config.redis_connection)
20
26
  end
21
27
  end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "redis-objects"
3
+ require "redis/objects"
4
4
  require "singleton"
5
5
  require "dry/inflector"
6
6
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Strum
4
4
  module Pipeline
5
- VERSION = "0.1.1"
5
+ VERSION = "0.1.2"
6
6
  end
7
7
  end
@@ -10,15 +10,15 @@ Gem::Specification.new do |spec|
10
10
 
11
11
  spec.summary = "Defining data processing Pipeline"
12
12
  # spec.description = "Defining data processing Pipeline"
13
- spec.homepage = "https://gitlab.com/strum/strum-pipeline"
13
+ spec.homepage = "https://gitlab.com/strum-rb/strum-pipeline"
14
14
  spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
15
15
 
16
16
  spec.metadata["allowed_push_host"] = "https://rubygems.org"
17
17
 
18
18
  spec.metadata["homepage_uri"] = spec.homepage
19
- spec.metadata["source_code_uri"] = "https://gitlab.com/strum/strum-pipeline"
20
- spec.metadata["readme_uri"] = "https://gitlab.com/strum/strum-pipeline/README.md"
21
- spec.metadata["changelog_uri"] = "https://gitlab.com/strum/strum-pipeline/CHANGELOG.md"
19
+ spec.metadata["source_code_uri"] = "https://gitlab.com/strum-rb/strum-pipeline"
20
+ spec.metadata["readme_uri"] = "https://gitlab.com/strum-rb/strum-pipeline/-/blob/master/README.md"
21
+ spec.metadata["changelog_uri"] = "https://gitlab.com/strum-rb/strum-pipeline/-/blob/master/CHANGELOG.md"
22
22
 
23
23
  # Specify which files should be added to the gem when it is released.
24
24
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: strum-pipeline
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Serhiy Nazarov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-06-02 00:00:00.000000000 Z
11
+ date: 2021-07-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bunny
@@ -160,14 +160,14 @@ files:
160
160
  - lib/strum/pipeline/storage.rb
161
161
  - lib/strum/pipeline/version.rb
162
162
  - strum-pipeline.gemspec
163
- homepage: https://gitlab.com/strum/strum-pipeline
163
+ homepage: https://gitlab.com/strum-rb/strum-pipeline
164
164
  licenses: []
165
165
  metadata:
166
166
  allowed_push_host: https://rubygems.org
167
- homepage_uri: https://gitlab.com/strum/strum-pipeline
168
- source_code_uri: https://gitlab.com/strum/strum-pipeline
169
- readme_uri: https://gitlab.com/strum/strum-pipeline/README.md
170
- changelog_uri: https://gitlab.com/strum/strum-pipeline/CHANGELOG.md
167
+ homepage_uri: https://gitlab.com/strum-rb/strum-pipeline
168
+ source_code_uri: https://gitlab.com/strum-rb/strum-pipeline
169
+ readme_uri: https://gitlab.com/strum-rb/strum-pipeline/-/blob/master/README.md
170
+ changelog_uri: https://gitlab.com/strum-rb/strum-pipeline/-/blob/master/CHANGELOG.md
171
171
  post_install_message:
172
172
  rdoc_options: []
173
173
  require_paths: