aws-dev-utils 1.4.2 → 1.4.3
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cf214f05f27ab000665e7f919c6ccafdb696f190980f5c93569d4d6483c08e60
|
4
|
+
data.tar.gz: e2f1ecbf89b6313f9292c32ca2863c9b31c20b6d6964ba89e6d91a2298a60ec8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ba20b7e991d5db14ee9120d3527600f665e6445c88743ba6fec50c08c1d1b89fa82e57c00ea9c2319a67373f0122ab3fb0555d7bc9aa2c6eb1be5d1b0024c9c4
|
7
|
+
data.tar.gz: 1a9399a35a96b17b8df01a24f03f42e169e44bbd948f082989903f0895a9b4ae1e30088beb741fc95f8eb57aca98bcb664a8380b8168faec59176757003b78de
|
@@ -4,14 +4,21 @@ module AwsDevUtils
|
|
4
4
|
module Backend
|
5
5
|
class Redis
|
6
6
|
# :nocov:
|
7
|
+
# Initialize a new redis client
|
8
|
+
# @params [String] url - specify redis url connection
|
7
9
|
def initialize url='redis://localhost:6379'
|
8
10
|
@redis = ::Redis.new(url: url)
|
9
11
|
end
|
10
12
|
|
13
|
+
# Get the value of key. If not found, returns nil
|
11
14
|
def get key
|
12
15
|
@redis.get key
|
13
16
|
end
|
14
17
|
|
18
|
+
# Set key to hold the value and set key to timeout after the a given expiration time(in seconds).
|
19
|
+
# @param [Object] key
|
20
|
+
# @param [Object] value
|
21
|
+
# @param [Integer] exp - the key-value timeout
|
15
22
|
def set key, value, exp
|
16
23
|
@redis.setex key, exp, value
|
17
24
|
end
|
@@ -4,6 +4,10 @@ module AwsDevUtils
|
|
4
4
|
class CacheWrapper
|
5
5
|
include AwsDevUtils::Utils
|
6
6
|
|
7
|
+
# Initialize a new CacheWrapper
|
8
|
+
# Internal use only
|
9
|
+
# @params client - Aws client / NextTokenWrapper / RetryWrapper
|
10
|
+
# @param [Integer] exp - the key-value timeout
|
7
11
|
def initialize client, exp=60
|
8
12
|
@client = client
|
9
13
|
@exp = exp
|
@@ -1,7 +1,10 @@
|
|
1
1
|
module AwsDevUtils
|
2
2
|
class NextTokenWrapper
|
3
3
|
|
4
|
-
|
4
|
+
# Initialize a new NextTokenWrapper
|
5
|
+
# @params client - Aws client / CacheWrapper / RetryWrapper
|
6
|
+
# @param [Integer] max - max number of requests
|
7
|
+
def initialize client, max=100 #:nodoc:
|
5
8
|
@client = client
|
6
9
|
@max = max
|
7
10
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aws-dev-utils
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Infastructure
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-07
|
11
|
+
date: 2019-08-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk-core
|