esse-redis_storage 0.0.2 → 0.1.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
  SHA256:
3
- metadata.gz: 1c05d60be8578e56e72f8eaa1ed86bd0e2ddc4155aa4e401b46f1baea2644887
4
- data.tar.gz: fcf6aebf13c1dda145e8be6f1eab49a8f7fe70a4d5dd5e48be9d07c77e8ae712
3
+ metadata.gz: 87dba08abdec3e21cda41dc59d5ee0ae68bcb5368ead487ba4f30158c5c04b3d
4
+ data.tar.gz: 593a7649db186bca07494265f81dbc40704bfcae36b38b84826b2eea26a5a7b6
5
5
  SHA512:
6
- metadata.gz: 153cb2cfa231b6f4657e779923db891e164a99f6c6401afaa5cae1b9c2e8893e2675cf26dc7cfc22f3d950ba04995b443c7a729a153ea2b457ef92c45edd5dcf
7
- data.tar.gz: ff228cfae97984539f88920de7888df7809517d9c4a25aa2b842b530f06bb0a6864ecaf2c4db29cd0fff54060eac494c0c169f43fd0239d9a8a10c261d5f5dd6
6
+ metadata.gz: d77fba357ac60699d7b32e81dce475ffa156fcb6d55df25bec6a887f0789672e304af25790ec6d5667ebece6471d79c7b2a010be02f65d6a44682099879f8e05
7
+ data.tar.gz: f544947816a3b8b1a00bd2487c13130587274a7f80956ad43497fc4c58e805ba4b3556218af2270486bbdbd7ed5ac7e6f7f8def32a1a22866ac82896d95da68c
data/Gemfile.lock CHANGED
@@ -1,17 +1,18 @@
1
1
  GIT
2
2
  remote: https://github.com/marcosgz/esse.git
3
- revision: ebbe8016650c2d090873a8799e8b127a39a592bf
3
+ revision: 7d8fef8646a2f6acc3bfa475f351cfcd7d88fe17
4
4
  branch: main
5
5
  specs:
6
- esse (0.2.6)
6
+ esse (0.3.4)
7
7
  multi_json
8
8
  thor (>= 0.19)
9
9
 
10
10
  PATH
11
11
  remote: .
12
12
  specs:
13
- esse-redis_storage (0.0.2)
14
- esse (>= 0.2.4)
13
+ esse-redis_storage (0.1.0)
14
+ esse (>= 0.3.2)
15
+ multi_json (>= 1.0.0)
15
16
  redis (>= 4.0.0)
16
17
 
17
18
  GEM
@@ -31,9 +31,10 @@ module Esse
31
31
  def enqueue(id: nil, values: [])
32
32
  return if values.nil? || values.empty?
33
33
 
34
+ values = ::Esse::ArrayUtils.wrap(values)
34
35
  batch_id = id || self.class.batch_id
35
36
  with do |conn|
36
- conn.hset(name, batch_id, values.join(","))
37
+ conn.hset(name, batch_id, ::MultiJson.dump(values))
37
38
  end
38
39
  batch_id
39
40
  end
@@ -46,7 +47,7 @@ module Esse
46
47
  values = conn.hget(name, batch_id)
47
48
  return unless values
48
49
 
49
- yield values.split(",")
50
+ yield ::MultiJson.load(values)
50
51
  conn.hdel(name, batch_id)
51
52
  end
52
53
  end
@@ -75,7 +76,7 @@ module Esse
75
76
  def each
76
77
  with do |conn|
77
78
  conn.hscan_each(name, count: 1000) do |batch_id, values|
78
- yield batch_id, values.split(",")
79
+ yield batch_id, ::MultiJson.load(values)
79
80
  end
80
81
  end
81
82
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Esse
4
4
  module RedisStorage
5
- VERSION = "0.0.2"
5
+ VERSION = "0.1.0"
6
6
  end
7
7
  end
@@ -2,6 +2,7 @@
2
2
 
3
3
  require "esse"
4
4
  require "redis"
5
+ require "multi_json"
5
6
  require "forwardable"
6
7
  require "securerandom"
7
8
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: esse-redis_storage
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marcos G. Zimmermann
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-07-18 00:00:00.000000000 Z
11
+ date: 2024-07-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: esse
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 0.2.4
19
+ version: 0.3.2
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 0.2.4
26
+ version: 0.3.2
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: redis
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -38,6 +38,20 @@ dependencies:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: 4.0.0
41
+ - !ruby/object:Gem::Dependency
42
+ name: multi_json
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: 1.0.0
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: 1.0.0
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: connection_pool
43
57
  requirement: !ruby/object:Gem::Requirement