eventq_base 1.12.0 → 1.13.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c67d42de6b2da12c363d3df36b4d48b9e2e57c72
4
- data.tar.gz: 0e503db2f24dc1942dd4e61902f1868e9957d0c0
3
+ metadata.gz: 733440105b413188edbee46b4ec59db655d2f7fd
4
+ data.tar.gz: 9d8e062f176c779a0c012193b153f8b9acb53704
5
5
  SHA512:
6
- metadata.gz: 4b21fea5d200f7c198cc472a95b5ed3a5436760f62bc18832890d9b3e9517112d7ba206097a793b3c2c2a3de452de8d1ad2ba9773ef557b862d32d9a616007c8
7
- data.tar.gz: 01652e72f470f1afe5bbed970ee37c1d2895ecaa54f967d1e2b58043cfb5a92072024ccba17e0a33397a31a7df6aff4a129753cacd17fbc2f0286ab5dcf0e939
6
+ metadata.gz: f57ad9b72bd86980650f8a0c65677f6e95e91a1cd35fd4f4d3c8822f12624bf68f1e115e55e98dc2f047c77b45ded5c62fac2c95ebefcc16119500b59d57c9fe
7
+ data.tar.gz: d38a0f44a7648a7c2c265e490de0e0b6eb38d2b1eaa527e8d935fd370876c901e92a7d3947fb802f7934ead61f08c40323ffa2ee64f8e9228f91e11d65c063b3
@@ -6,7 +6,7 @@ module EventQ
6
6
  end
7
7
 
8
8
  def self.serialization_provider
9
- @serialization_provider ||= EventQ::SerializationProviders::OJ_PROVIDER
9
+ @serialization_provider ||= EventQ::SerializationProviders::BINARY_PROVIDER
10
10
  end
11
11
 
12
12
  def self.signature_provider=(value)
@@ -24,6 +24,7 @@ module EventQ
24
24
  return true
25
25
  end
26
26
 
27
+ require 'redlock'
27
28
  lock = Redlock::Client.new([ @server_url ]).lock(nonce, @timeout)
28
29
  if lock == false
29
30
  EventQ.log(:info, "[#{self.class}] - Message has already been processed: #{nonce}")
@@ -0,0 +1,15 @@
1
+ module EventQ
2
+ module SerializationProviders
3
+ class BinarySerializationProvider
4
+
5
+ def serialize(object)
6
+ Marshal::dump(object)
7
+ end
8
+
9
+ def deserialize(msg)
10
+ Marshal::load(msg)
11
+ end
12
+
13
+ end
14
+ end
15
+ end
@@ -3,6 +3,9 @@ module EventQ
3
3
  class JsonSerializationProvider
4
4
 
5
5
  def initialize
6
+ require 'json'
7
+ require 'class_kit'
8
+ require 'hash_kit'
6
9
  @class_kit_helper = ClassKit::Helper.new
7
10
  @hash_helper = HashKit::Helper.new
8
11
  end
@@ -3,6 +3,7 @@ module EventQ
3
3
  class OjSerializationProvider
4
4
 
5
5
  def initialize
6
+ require 'oj'
6
7
  @json_serializer = EventQ::SerializationProviders::JsonSerializationProvider.new
7
8
  end
8
9
 
@@ -1,17 +1,20 @@
1
1
  require_relative 'serialization_providers/json_serialization_provider'
2
2
  require_relative 'serialization_providers/oj_serialization_provider'
3
+ require_relative 'serialization_providers/binary_serialization_provider'
3
4
 
4
5
  module EventQ
5
6
  module SerializationProviders
6
7
 
7
8
  OJ_PROVIDER = 'oj'.freeze
8
9
  JSON_PROVIDER = 'json'.freeze
10
+ BINARY_PROVIDER = 'binary'.freeze
9
11
 
10
12
  class Manager
11
13
  def initialize
12
14
  @providers = {}
13
15
  @providers[OJ_PROVIDER] = EventQ::SerializationProviders::OjSerializationProvider
14
16
  @providers[JSON_PROVIDER] = EventQ::SerializationProviders::JsonSerializationProvider
17
+ @providers[BINARY_PROVIDER] = EventQ::SerializationProviders::BinarySerializationProvider
15
18
  end
16
19
 
17
20
  def get_provider(provider_type)
@@ -1,11 +1,10 @@
1
- require 'openssl'
2
- require 'base64'
3
-
4
1
  module EventQ
5
2
  module SignatureProviders
6
3
  class Sha256SignatureProvider
7
4
 
8
5
  def initialize
6
+ require 'openssl'
7
+ require 'base64'
9
8
  @serializer = serialization_provider_manager.get_provider(EventQ::Configuration.serialization_provider)
10
9
  end
11
10
 
@@ -1,3 +1,3 @@
1
1
  module EventqBase
2
- VERSION = "1.12.0"
2
+ VERSION = "1.13.0"
3
3
  end
data/lib/eventq_base.rb CHANGED
@@ -1,9 +1,6 @@
1
1
  require 'securerandom'
2
- require 'class_kit'
3
- require 'hash_kit'
4
- require 'json_kit'
5
- require 'oj'
6
2
  require 'redlock'
3
+ require 'class_kit'
7
4
 
8
5
  require_relative 'eventq_base/version'
9
6
  require_relative 'eventq_base/eventq_logger'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eventq_base
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.12.0
4
+ version: 1.13.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - vaughanbrittonsage
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-06-14 00:00:00.000000000 Z
11
+ date: 2017-06-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -52,20 +52,6 @@ dependencies:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
- - !ruby/object:Gem::Dependency
56
- name: pry
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - ">="
60
- - !ruby/object:Gem::Version
61
- version: '0'
62
- type: :development
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - ">="
67
- - !ruby/object:Gem::Version
68
- version: '0'
69
55
  - !ruby/object:Gem::Dependency
70
56
  name: class_kit
71
57
  requirement: !ruby/object:Gem::Requirement
@@ -80,76 +66,6 @@ dependencies:
80
66
  - - ">="
81
67
  - !ruby/object:Gem::Version
82
68
  version: '0'
83
- - !ruby/object:Gem::Dependency
84
- name: hash_kit
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - ">="
88
- - !ruby/object:Gem::Version
89
- version: '0'
90
- type: :runtime
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - ">="
95
- - !ruby/object:Gem::Version
96
- version: '0'
97
- - !ruby/object:Gem::Dependency
98
- name: json_kit
99
- requirement: !ruby/object:Gem::Requirement
100
- requirements:
101
- - - ">="
102
- - !ruby/object:Gem::Version
103
- version: '0'
104
- type: :runtime
105
- prerelease: false
106
- version_requirements: !ruby/object:Gem::Requirement
107
- requirements:
108
- - - ">="
109
- - !ruby/object:Gem::Version
110
- version: '0'
111
- - !ruby/object:Gem::Dependency
112
- name: oj
113
- requirement: !ruby/object:Gem::Requirement
114
- requirements:
115
- - - ">="
116
- - !ruby/object:Gem::Version
117
- version: '0'
118
- type: :runtime
119
- prerelease: false
120
- version_requirements: !ruby/object:Gem::Requirement
121
- requirements:
122
- - - ">="
123
- - !ruby/object:Gem::Version
124
- version: '0'
125
- - !ruby/object:Gem::Dependency
126
- name: redlock
127
- requirement: !ruby/object:Gem::Requirement
128
- requirements:
129
- - - ">="
130
- - !ruby/object:Gem::Version
131
- version: '0'
132
- type: :runtime
133
- prerelease: false
134
- version_requirements: !ruby/object:Gem::Requirement
135
- requirements:
136
- - - ">="
137
- - !ruby/object:Gem::Version
138
- version: '0'
139
- - !ruby/object:Gem::Dependency
140
- name: openssl
141
- requirement: !ruby/object:Gem::Requirement
142
- requirements:
143
- - - ">="
144
- - !ruby/object:Gem::Version
145
- version: '0'
146
- type: :runtime
147
- prerelease: false
148
- version_requirements: !ruby/object:Gem::Requirement
149
- requirements:
150
- - - ">="
151
- - !ruby/object:Gem::Version
152
- version: '0'
153
69
  description: This gem contains the base classes and contracts required by any eventq
154
70
  implementations.
155
71
  email:
@@ -175,6 +91,7 @@ files:
175
91
  - lib/eventq_base/queue_message.rb
176
92
  - lib/eventq_base/queue_worker_contract.rb
177
93
  - lib/eventq_base/serialization_providers.rb
94
+ - lib/eventq_base/serialization_providers/binary_serialization_provider.rb
178
95
  - lib/eventq_base/serialization_providers/json_serialization_provider.rb
179
96
  - lib/eventq_base/serialization_providers/oj_serialization_provider.rb
180
97
  - lib/eventq_base/signature_providers.rb