prefab-cloud-ruby 0.0.25 → 0.0.26
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/Gemfile.lock +4 -4
- data/README.md +11 -9
- data/VERSION +1 -1
- data/lib/prefab/client.rb +5 -1
- data/lib/prefab/config_client.rb +4 -1
- data/prefab-cloud-ruby.gemspec +7 -7
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bf62820eed07ee6ad36cbc9a63bd48529db8b538
|
4
|
+
data.tar.gz: '001991a7e61fb7ee0174615d68735d3d2aa0613c'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 62d3e17ea14421d7885d5973c0540b1d01476761ce7f9a00ddf4ddd56bbe86a11041e2c5152d927343e7fc57b98d0c9d58fb7924235e3fe0a172a2ad4dd9abc7
|
7
|
+
data.tar.gz: 508c23641e78b92c20e682db67bb4fa20c9200afca748044c5c51bdc9e254cb7f432e6c81fba2ea0b087c668a58763579aeee6353a2e1a019441774371210f7f
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -35,10 +35,10 @@ GEM
|
|
35
35
|
faraday (~> 0.8)
|
36
36
|
hashie (~> 3.5, >= 3.5.2)
|
37
37
|
oauth2 (~> 1.0)
|
38
|
-
google-protobuf (3.6.
|
39
|
-
googleapis-common-protos-types (1.0.
|
38
|
+
google-protobuf (3.6.1)
|
39
|
+
googleapis-common-protos-types (1.0.2)
|
40
40
|
google-protobuf (~> 3.0)
|
41
|
-
grpc (1.
|
41
|
+
grpc (1.14.1)
|
42
42
|
google-protobuf (~> 3.1)
|
43
43
|
googleapis-common-protos-types (~> 1.0.0)
|
44
44
|
grpc-tools (1.11.0)
|
@@ -105,7 +105,7 @@ DEPENDENCIES
|
|
105
105
|
aws-sdk-s3 (~> 1)
|
106
106
|
bundler (~> 1.0)
|
107
107
|
concurrent-ruby (~> 1.0, >= 1.0.5)
|
108
|
-
grpc (~> 1.
|
108
|
+
grpc (~> 1.14.1)
|
109
109
|
grpc-tools (~> 1.11.0)
|
110
110
|
juwelier (~> 2.4.9)
|
111
111
|
rdoc (~> 3.12)
|
data/README.md
CHANGED
@@ -19,25 +19,27 @@ See full documentation https://www.prefab.cloud/documentation/installation
|
|
19
19
|
|
20
20
|
## Supports
|
21
21
|
|
22
|
+
* [FeatureFlags](https://www.prefab.cloud/documentation/feature_flags) as a Service
|
22
23
|
* [RateLimits](https://www.prefab.cloud/documentation/basic_rate_limits)
|
23
24
|
* Millions of individual limits sharing the same policies
|
24
25
|
* WebUI for tweaking limits & feature flags
|
25
26
|
* Infinite retention for [deduplication workflows](https://www.prefab.cloud/documentation/once_and_only_once)
|
26
|
-
* [FeatureFlags](https://www.prefab.cloud/documentation/feature_flags) as a Service
|
27
27
|
|
28
|
-
## Important note about Forking
|
28
|
+
## Important note about Forking and realtime updates
|
29
|
+
Many ruby web servers fork. GRPC does not like to be forked. You should manually start gRPC streaming in the on_worker_boot or after_fork hook of your server. See some details on GRPC and forking: https://github.com/grpc/grpc/issues/7951#issuecomment-335998583
|
29
30
|
|
30
|
-
|
31
|
+
```ruby
|
32
|
+
|
33
|
+
#config/initializers/prefab.rb
|
34
|
+
$prefab = Prefab::Client.new(shared_cache: Rails.cache,
|
35
|
+
logdev: $stdout)
|
36
|
+
Rails.logger = $prefab.log
|
37
|
+
```
|
31
38
|
|
32
39
|
```ruby
|
33
40
|
#puma.rb
|
34
41
|
on_worker_boot do
|
35
|
-
$prefab
|
36
|
-
logdev: $stdout,
|
37
|
-
log_formatter: proc {|severity, datetime, progname, msg|
|
38
|
-
"#{severity.ljust(5)} #{datetime}: #{progname} #{msg}\n"
|
39
|
-
})
|
40
|
-
Rails.logger = $prefab.log
|
42
|
+
$prefab.start_streaming
|
41
43
|
end
|
42
44
|
```
|
43
45
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.26
|
data/lib/prefab/client.rb
CHANGED
@@ -3,6 +3,10 @@ module Prefab
|
|
3
3
|
|
4
4
|
MAX_SLEEP_SEC = 10
|
5
5
|
BASE_SLEEP_SEC = 0.5
|
6
|
+
DEFAULT_LOG_FORMATTER = proc {|severity, datetime, progname, msg|
|
7
|
+
"#{severity.ljust(5)} #{datetime}: #{progname} #{msg}\n"
|
8
|
+
}
|
9
|
+
|
6
10
|
|
7
11
|
attr_reader :account_id, :shared_cache, :stats, :namespace, :creds, :interceptor, :api_key
|
8
12
|
|
@@ -12,7 +16,7 @@ module Prefab
|
|
12
16
|
shared_cache: nil, # Something that quacks like Rails.cache ideally memcached
|
13
17
|
local: false,
|
14
18
|
namespace: "",
|
15
|
-
log_formatter:
|
19
|
+
log_formatter: DEFAULT_LOG_FORMATTER
|
16
20
|
)
|
17
21
|
raise "No API key. Set PREFAB_API_KEY env var" if api_key.nil? || api_key.empty?
|
18
22
|
@logdev = (logdev || $stdout)
|
data/lib/prefab/config_client.rb
CHANGED
@@ -17,10 +17,13 @@ module Prefab
|
|
17
17
|
@s3 = Aws::S3::Resource.new(region: 'us-east-1')
|
18
18
|
|
19
19
|
load_checkpoint
|
20
|
-
start_api_connection_thread(@config_loader.highwater_mark)
|
21
20
|
start_checkpointing_thread
|
22
21
|
end
|
23
22
|
|
23
|
+
def start_streaming
|
24
|
+
start_api_connection_thread(@config_loader.highwater_mark)
|
25
|
+
end
|
26
|
+
|
24
27
|
def get(prop)
|
25
28
|
@initialization_lock.with_read_lock do
|
26
29
|
@config_resolver.get(prop)
|
data/prefab-cloud-ruby.gemspec
CHANGED
@@ -2,16 +2,16 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Juwelier::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: prefab-cloud-ruby 0.0.
|
5
|
+
# stub: prefab-cloud-ruby 0.0.26 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "prefab-cloud-ruby".freeze
|
9
|
-
s.version = "0.0.
|
9
|
+
s.version = "0.0.26"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib".freeze]
|
13
13
|
s.authors = ["Jeff Dwyer".freeze]
|
14
|
-
s.date = "2018-
|
14
|
+
s.date = "2018-09-05"
|
15
15
|
s.description = "RateLimits & Config as a service".freeze
|
16
16
|
s.email = "jdwyer@prefab.cloud".freeze
|
17
17
|
s.extra_rdoc_files = [
|
@@ -51,14 +51,14 @@ Gem::Specification.new do |s|
|
|
51
51
|
]
|
52
52
|
s.homepage = "http://github.com/prefab-cloud/prefab-cloud-ruby".freeze
|
53
53
|
s.licenses = ["MIT".freeze]
|
54
|
-
s.rubygems_version = "2.6.
|
54
|
+
s.rubygems_version = "2.6.13".freeze
|
55
55
|
s.summary = "Prefab Ruby Infrastructure".freeze
|
56
56
|
|
57
57
|
if s.respond_to? :specification_version then
|
58
58
|
s.specification_version = 4
|
59
59
|
|
60
60
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
61
|
-
s.add_runtime_dependency(%q<grpc>.freeze, ["~> 1.
|
61
|
+
s.add_runtime_dependency(%q<grpc>.freeze, ["~> 1.14.1"])
|
62
62
|
s.add_runtime_dependency(%q<concurrent-ruby>.freeze, [">= 1.0.5", "~> 1.0"])
|
63
63
|
s.add_runtime_dependency(%q<aws-sdk-s3>.freeze, ["~> 1"])
|
64
64
|
s.add_development_dependency(%q<grpc-tools>.freeze, ["~> 1.11.0"])
|
@@ -68,7 +68,7 @@ Gem::Specification.new do |s|
|
|
68
68
|
s.add_development_dependency(%q<juwelier>.freeze, ["~> 2.4.9"])
|
69
69
|
s.add_development_dependency(%q<simplecov>.freeze, [">= 0"])
|
70
70
|
else
|
71
|
-
s.add_dependency(%q<grpc>.freeze, ["~> 1.
|
71
|
+
s.add_dependency(%q<grpc>.freeze, ["~> 1.14.1"])
|
72
72
|
s.add_dependency(%q<concurrent-ruby>.freeze, [">= 1.0.5", "~> 1.0"])
|
73
73
|
s.add_dependency(%q<aws-sdk-s3>.freeze, ["~> 1"])
|
74
74
|
s.add_dependency(%q<grpc-tools>.freeze, ["~> 1.11.0"])
|
@@ -79,7 +79,7 @@ Gem::Specification.new do |s|
|
|
79
79
|
s.add_dependency(%q<simplecov>.freeze, [">= 0"])
|
80
80
|
end
|
81
81
|
else
|
82
|
-
s.add_dependency(%q<grpc>.freeze, ["~> 1.
|
82
|
+
s.add_dependency(%q<grpc>.freeze, ["~> 1.14.1"])
|
83
83
|
s.add_dependency(%q<concurrent-ruby>.freeze, [">= 1.0.5", "~> 1.0"])
|
84
84
|
s.add_dependency(%q<aws-sdk-s3>.freeze, ["~> 1"])
|
85
85
|
s.add_dependency(%q<grpc-tools>.freeze, ["~> 1.11.0"])
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: prefab-cloud-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.26
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeff Dwyer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-09-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: grpc
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 1.
|
19
|
+
version: 1.14.1
|
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: 1.
|
26
|
+
version: 1.14.1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: concurrent-ruby
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -199,7 +199,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
199
199
|
version: '0'
|
200
200
|
requirements: []
|
201
201
|
rubyforge_project:
|
202
|
-
rubygems_version: 2.6.
|
202
|
+
rubygems_version: 2.6.13
|
203
203
|
signing_key:
|
204
204
|
specification_version: 4
|
205
205
|
summary: Prefab Ruby Infrastructure
|