eventq_base 1.6.9 → 1.6.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/eventq_base.rb +4 -0
- data/lib/eventq_base/configuration.rb +2 -3
- data/lib/eventq_base/queue_message.rb +5 -4
- data/lib/eventq_base/serialization_providers.rb +1 -1
- data/lib/eventq_base/serialization_providers/json_serialization_provider.rb +6 -6
- data/lib/eventq_base/serialization_providers/oj_serialization_provider.rb +5 -6
- data/lib/eventq_base/version.rb +1 -1
- metadata +17 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 146175d5aa5fcf58b9e2d98fe54f71d728a2194c
|
4
|
+
data.tar.gz: 64f6a637d34b1175e5adc3e9c3980691ead9e8b7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 11c66301f44307500761623556611ccbb86fa07c4b81085d0c6afe750e52fc05a32e70fdd91573e473b350c350367b8a28b9597af1be656e102a023ffc518631
|
7
|
+
data.tar.gz: 0e62b01f65651353e6f14ac02d1ace7a93240466b8da639862a5f1d75857d934bb891d9c74106f798bc49dcbc377171b10d3d08954ea4bc6d916d19840ffe149
|
data/lib/eventq_base.rb
CHANGED
@@ -11,3 +11,7 @@ require_relative 'eventq_base/subscription_manager_contract'
|
|
11
11
|
require_relative 'eventq_base/eventq_client_contract'
|
12
12
|
require_relative 'eventq_base/configuration'
|
13
13
|
require_relative 'eventq_base/serialization_providers'
|
14
|
+
|
15
|
+
require 'class_kit'
|
16
|
+
require 'hash_kit'
|
17
|
+
|
@@ -7,10 +7,9 @@ module EventQ
|
|
7
7
|
|
8
8
|
def self.serialization_provider
|
9
9
|
if @serialization_provider == nil
|
10
|
-
|
11
|
-
else
|
12
|
-
return @serialization_provider
|
10
|
+
@serialization_provider = EventQ::SerializationProviders::OJ_PROVIDER
|
13
11
|
end
|
12
|
+
return @serialization_provider
|
14
13
|
end
|
15
14
|
|
16
15
|
end
|
@@ -2,14 +2,15 @@ module EventQ
|
|
2
2
|
class QueueMessage
|
3
3
|
extend ClassKit
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
5
|
+
attr_accessor :retry_attempts, type: Integer
|
6
|
+
attr_accessor :type, type: String
|
7
|
+
attr_accessor :content, type: Hash
|
8
|
+
attr_accessor :created, type: DateTime
|
9
9
|
|
10
10
|
def initialize
|
11
11
|
@retry_attempts = 0
|
12
12
|
@created = DateTime.now
|
13
13
|
end
|
14
|
+
|
14
15
|
end
|
15
16
|
end
|
@@ -17,7 +17,7 @@ module EventQ
|
|
17
17
|
def get_provider(provider_type)
|
18
18
|
provider = @providers[provider_type]
|
19
19
|
if provider == nil
|
20
|
-
raise "Invalid provider type
|
20
|
+
raise "Invalid provider type specified: #{provider_type}"
|
21
21
|
end
|
22
22
|
return provider
|
23
23
|
end
|
@@ -1,19 +1,19 @@
|
|
1
|
-
require 'class_kit'
|
2
|
-
|
3
1
|
module EventQ
|
4
2
|
module SerializationProviders
|
5
3
|
class JsonSerializationProvider
|
6
4
|
|
7
5
|
def initialize
|
8
|
-
@
|
6
|
+
@class_kit_helper = ClassKit::Helper.new
|
7
|
+
@hash_helper = HashKit::Helper.new
|
9
8
|
end
|
10
9
|
|
11
10
|
def serialize(object)
|
12
|
-
|
11
|
+
hash = @hash_helper.to_hash(object)
|
12
|
+
return Json.dump(hash)
|
13
13
|
end
|
14
14
|
|
15
|
-
def deserialize(
|
16
|
-
return @
|
15
|
+
def deserialize(json)
|
16
|
+
return @class_kit_helper.from_json(json: json, klass: EventQ::QueueMessage)
|
17
17
|
end
|
18
18
|
|
19
19
|
end
|
@@ -1,22 +1,21 @@
|
|
1
|
-
require 'hash_kit'
|
2
|
-
|
3
1
|
module EventQ
|
4
2
|
module SerializationProviders
|
5
3
|
class OjSerializationProvider
|
6
4
|
|
7
5
|
def initialize
|
8
|
-
@
|
6
|
+
@json_serializer = EventQ::SerializationProviders::JsonSerializationProvider.new
|
9
7
|
end
|
10
8
|
|
11
9
|
def serialize(object)
|
12
|
-
Oj.dump(object)
|
10
|
+
return Oj.dump(object)
|
13
11
|
end
|
14
12
|
|
15
13
|
def deserialize(json)
|
14
|
+
Oj.load(json)
|
16
15
|
begin
|
17
|
-
return Oj.load(
|
16
|
+
return Oj.load(payload)
|
18
17
|
rescue Oj::ParseError
|
19
|
-
return @
|
18
|
+
return @json_serializer.deserialize(json)
|
20
19
|
end
|
21
20
|
end
|
22
21
|
end
|
data/lib/eventq_base/version.rb
CHANGED
metadata
CHANGED
@@ -1,69 +1,69 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eventq_base
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.6.
|
4
|
+
version: 1.6.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- vaughanbrittonsage
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-09-
|
11
|
+
date: 2016-09-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - ~>
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '1.11'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - ~>
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.11'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - ~>
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '10.0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - ~>
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '10.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: class_kit
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: hash_kit
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0'
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
description: This gem contains the base classes and contracts required by any eventq
|
@@ -76,6 +76,7 @@ extra_rdoc_files: []
|
|
76
76
|
files:
|
77
77
|
- bin/console
|
78
78
|
- bin/setup
|
79
|
+
- lib/eventq_base.rb
|
79
80
|
- lib/eventq_base/configuration.rb
|
80
81
|
- lib/eventq_base/event_raised_exchange.rb
|
81
82
|
- lib/eventq_base/event_raised_queue.rb
|
@@ -86,12 +87,11 @@ files:
|
|
86
87
|
- lib/eventq_base/queue.rb
|
87
88
|
- lib/eventq_base/queue_message.rb
|
88
89
|
- lib/eventq_base/queue_worker_contract.rb
|
90
|
+
- lib/eventq_base/serialization_providers.rb
|
89
91
|
- lib/eventq_base/serialization_providers/json_serialization_provider.rb
|
90
92
|
- lib/eventq_base/serialization_providers/oj_serialization_provider.rb
|
91
|
-
- lib/eventq_base/serialization_providers.rb
|
92
93
|
- lib/eventq_base/subscription_manager_contract.rb
|
93
94
|
- lib/eventq_base/version.rb
|
94
|
-
- lib/eventq_base.rb
|
95
95
|
homepage: https://github.com/vaughanbrittonsage/eventq
|
96
96
|
licenses:
|
97
97
|
- MIT
|
@@ -102,19 +102,18 @@ require_paths:
|
|
102
102
|
- lib
|
103
103
|
required_ruby_version: !ruby/object:Gem::Requirement
|
104
104
|
requirements:
|
105
|
-
- -
|
105
|
+
- - ">="
|
106
106
|
- !ruby/object:Gem::Version
|
107
107
|
version: '0'
|
108
108
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
109
109
|
requirements:
|
110
|
-
- -
|
110
|
+
- - ">="
|
111
111
|
- !ruby/object:Gem::Version
|
112
112
|
version: '0'
|
113
113
|
requirements: []
|
114
114
|
rubyforge_project:
|
115
|
-
rubygems_version: 2.
|
115
|
+
rubygems_version: 2.5.1
|
116
116
|
signing_key:
|
117
117
|
specification_version: 4
|
118
118
|
summary: This gem contains the base classes and contracts required by any eventq implementations.
|
119
119
|
test_files: []
|
120
|
-
has_rdoc:
|