strum-pipeline 0.2.1 → 0.2.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: e892a52a297b185245dfabe8c717dcbeaedc01fddc9ef15940b0d9cce9a8c466
4
- data.tar.gz: 59c8c2dd248bbd629bd4edb4b179a965bc08ece2aa0342d4bf179498ebcf20a6
3
+ metadata.gz: 6baedd0bf4dd58d4b40ed9e8a0f5549bea66b67eed85dba35bb28572489da72d
4
+ data.tar.gz: e7ccc89bf36eda404d95f5a2f155a1fbb589848035b20c0e710038a4684523ce
5
5
  SHA512:
6
- metadata.gz: 1b24214f5ff1d39ea96e6071ecd80891c605055c6168f787e79844b8672bc4c5cefabd6ff9965155b2f77e695bb9e94f7faeb26cb5e77facd9969bcb9e2489fa
7
- data.tar.gz: 58803567d51e7fb44c5da6c4b2dd7c630f83ea9d027ed3add32a748041706bd3956ecc791652c50bc5e4a884502130c9f23fc34a4a0979b383ebdf8c4807046d
6
+ metadata.gz: f6ce24968a4e232d2093114154a53d956f3af7a332e8bade0aef180f8c5cb19c44d83128c2a9b2553dcb620d9a37f621de89deefc63a90a820c802f3ec0c95f2
7
+ data.tar.gz: 5ed805498082ae9c3799beb7132b05dea20909aa5b46473a62143059c0dbcac8aa4caac3d133822efa9034c942600b7ca4d0a4b0c4175c27bde2b6fd5e546ac6
data/CHANGELOG.md CHANGED
@@ -2,7 +2,11 @@
2
2
  # Changelog
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
- ## [0.2.1] - 2023-01-11
5
+ ## [0.2.2] - 2023-04-25
6
+ ### Added
7
+ - `bind_to_pipeline` setting to be able to define if strum-pipeline binds init/steps to pipeline or not by [@valeriia.kolisnyk].
8
+
9
+ ## [0.2.1] - 2023-04-20
6
10
  ### Changed
7
11
  - `strum-esb` dependency version to `~> 0.4` by [@valeriia.kolisnyk].
8
12
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- strum-pipeline (0.2.1)
4
+ strum-pipeline (0.2.2)
5
5
  bunny (~> 2.15)
6
6
  connection_pool (~> 2.2)
7
7
  dry-configurable (~> 0.11)
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Strum
4
4
  module Pipeline
5
- VERSION = "0.2.1"
5
+ VERSION = "0.2.2"
6
6
  end
7
7
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  require "strum/pipeline/version"
4
4
  require "redis/objects"
5
- require 'connection_pool'
5
+ require "connection_pool"
6
6
  require "strum/esb"
7
7
  require "strum/pipeline/storage"
8
8
  require "dry/configurable"
@@ -18,6 +18,7 @@ module Strum
18
18
  port: ENV.fetch("PIPELINE_REDIS_PORT", "6379"),
19
19
  db: ENV.fetch("PIPELINE_REDIS_DB", "0")
20
20
  }
21
+ setting :bind_to_pipeline, true
21
22
  # setting :redis_connection_pool
22
23
 
23
24
  Strum::Esb.config.after_fork_hooks << proc do
@@ -68,16 +69,22 @@ module Strum
68
69
  Strum::Pipeline.config.ttl = interval
69
70
  end
70
71
 
72
+ def bind_to_pipeline(value)
73
+ Strum::Pipeline.config.bind_to_pipeline = value
74
+ end
75
+
71
76
  def inits
72
77
  @inits ||= []
73
78
  end
74
-
79
+
75
80
  def init(message_type, message_binding, handler = nil)
76
- bind_to(pipeline_name, message_type, message_binding, handler)
81
+ bind_to(pipeline_name, message_type, message_binding, handler) if Strum::Pipeline.config.bind_to_pipeline
77
82
  inits << handler_key(message_type, message_binding)
78
83
  end
79
84
 
80
85
  def step(message_type, message_binding, handler = nil)
86
+ return unless Strum::Pipeline.config.bind_to_pipeline
87
+
81
88
  bind_to(pipeline_name, message_type, message_binding, handler) do |bindings|
82
89
  bindings[:pipeline] ||= {}
83
90
  bindings[:pipeline][:name] = pipeline_name
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.2.1
4
+ version: 0.2.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: 2023-04-20 00:00:00.000000000 Z
11
+ date: 2023-04-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bunny