clustered_rpc 0.2.1 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 86711e87d4b0d02bd28442183c6dee164eddcf85f5907554c1ee122b41f26cb1
4
- data.tar.gz: 8b154d80b309ec854246c0daa2999a13b8556f59ddea7b3e080d3eb9f555bbee
3
+ metadata.gz: 3f45f11c95a23f17c8b9f0613a91c9569bf815013b332e9aba54947acc3fbdbc
4
+ data.tar.gz: 7a40bad936c8ff77831b4fd3973dae32dd1027d760799a85d47d3a0a540871a5
5
5
  SHA512:
6
- metadata.gz: 27b72f91705dbe127151885e9026c5bf05417e278eeb841573e177c512713764d2e76650a42bfd051f49d01aff8565e8bbfcb7079d31fac32bb5ac59f227aeb6
7
- data.tar.gz: 70483d8f0100c7f894b91ecb2a76f3739da972579f69285252756e3a074068f0dbd9917c161e3f04f5df6ab8f7f94aaea6aa80f29786994b1d5e7dc177fc931e
6
+ metadata.gz: 49b594ef30ada06bad7cd2f5c10b626208a64c0957b630905ebf766c37c6cd7e3f51e1f1d56a761299975137de9091cb2dd02739254c36e1ed27946ba722ca10
7
+ data.tar.gz: 1bf2c30fd8201d11054850f51b3f5adf84c921a2001046e8bdd792f68d025992ce1c4ac0d4456a9df5a77103552cd8fa5603e93b14f9b109dde662fd61d2f490
@@ -0,0 +1,51 @@
1
+ # This workflow uses actions that are not certified by GitHub.
2
+ # They are provided by a third-party and are governed by
3
+ # separate terms of service, privacy policy, and support
4
+ # documentation.
5
+ # This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
6
+ # For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
7
+
8
+ name: Ruby
9
+
10
+ on:
11
+ push:
12
+ branches: [ main ]
13
+ pull_request:
14
+ branches: [ main ]
15
+
16
+ jobs:
17
+ test:
18
+
19
+ runs-on: ubuntu-latest
20
+ strategy:
21
+ matrix:
22
+ ruby-version: [ '2.5', '2.6', '2.7']
23
+
24
+ # Service containers to run with `runner-job`
25
+ services:
26
+ # Label used to access the service container
27
+ redis:
28
+ # Docker Hub image
29
+ image: redis
30
+ # Set health checks to wait until redis has started
31
+ options: >-
32
+ --health-cmd "redis-cli ping"
33
+ --health-interval 10s
34
+ --health-timeout 5s
35
+ --health-retries 5
36
+ ports:
37
+ # Maps port 6379 on service container to the host
38
+ - 6379:6379
39
+
40
+ steps:
41
+ - uses: actions/checkout@v2
42
+ - name: Set up Ruby
43
+ # To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
44
+ # change this to (see https://github.com/ruby/setup-ruby#versioning):
45
+ # uses: ruby/setup-ruby@v1
46
+ uses: ruby/setup-ruby@473e4d8fe5dd94ee328fdfca9f8c9c7afc9dae5e
47
+ with:
48
+ ruby-version: ${{ matrix.ruby-version }}
49
+ bundler-cache: true # runs 'bundle install' and caches installed gems automatically
50
+ - name: Run tests
51
+ run: bundle exec rake
data/.travis.yml CHANGED
@@ -3,5 +3,14 @@ sudo: false
3
3
  language: ruby
4
4
  cache: bundler
5
5
  rvm:
6
- - 2.5.1
6
+ - 2.5
7
+ - 2.6
8
+ - 2.7
9
+ services:
10
+ - redis-server
11
+
7
12
  before_install: gem install bundler -v 2.0.2
13
+
14
+ #addons:
15
+ # code_climate:
16
+ # repo_token:
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- clustered_rpc (0.2.1)
4
+ clustered_rpc (0.3.0)
5
5
  activesupport
6
6
 
7
7
  GEM
@@ -16,14 +16,26 @@ GEM
16
16
  awesome_print (1.8.0)
17
17
  byebug (11.1.3)
18
18
  concurrent-ruby (1.1.8)
19
+ coveralls (0.7.2)
20
+ multi_json (~> 1.3)
21
+ rest-client (= 1.6.7)
22
+ simplecov (>= 0.7)
23
+ term-ansicolor (= 1.2.2)
24
+ thor (= 0.18.1)
19
25
  diff-lcs (1.4.4)
20
26
  docile (1.3.2)
21
27
  i18n (1.8.10)
22
28
  concurrent-ruby (~> 1.0)
23
29
  json (2.3.0)
30
+ mime-types (3.3.1)
31
+ mime-types-data (~> 3.2015)
32
+ mime-types-data (3.2021.0225)
24
33
  minitest (5.14.4)
34
+ multi_json (1.15.0)
25
35
  rake (10.5.0)
26
36
  redis (4.2.2)
37
+ rest-client (1.6.7)
38
+ mime-types (>= 1.16)
27
39
  rspec (3.10.0)
28
40
  rspec-core (~> 3.10.0)
29
41
  rspec-expectations (~> 3.10.0)
@@ -42,6 +54,10 @@ GEM
42
54
  json (>= 1.8, < 3)
43
55
  simplecov-html (~> 0.10.0)
44
56
  simplecov-html (0.10.2)
57
+ term-ansicolor (1.2.2)
58
+ tins (~> 0.8)
59
+ thor (0.18.1)
60
+ tins (0.13.2)
45
61
  tzinfo (2.0.4)
46
62
  concurrent-ruby (~> 1.0)
47
63
  zeitwerk (2.4.2)
@@ -54,6 +70,7 @@ DEPENDENCIES
54
70
  bundler (~> 2.0)
55
71
  byebug
56
72
  clustered_rpc!
73
+ coveralls (>= 0.7.0)
57
74
  rake (~> 10.0)
58
75
  redis
59
76
  rspec (~> 3.0)
data/README.md CHANGED
@@ -1,4 +1,8 @@
1
1
  # ClusteredRpc
2
+ [![RubyGems][gem_version_badge]][ruby_gems]
3
+ [![Travis CI][travis_ci_badge]][travis_ci]
4
+ [![Coveralls][coveralls_badge]][coveralls]
5
+
2
6
  _RPC = Remote Procedure Calls_
3
7
 
4
8
  ClusteredRpc allows you to run code on every ruby process running within your cluster.
@@ -141,3 +145,10 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/megali
141
145
  ## License
142
146
 
143
147
  The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
148
+
149
+ [gem_version_badge]: https://img.shields.io/gem/v/clustered_rpc.svg?style=flat
150
+ [ruby_gems]: http://rubygems.org/gems/clustered_rpc
151
+ [travis_ci]: http://travis-ci.org/megalithtracers/clustered_rpc
152
+ [travis_ci_badge]: https://travis-ci.com/megalithtracers/clustered_rpc.svg?branch=main
153
+ [coveralls_badge]: https://img.shields.io/coveralls/github/megalithtracers/clustered_rpc/main
154
+ [coveralls]: https://coveralls.io/github/megalithtracers/clustered_rpc
@@ -33,6 +33,7 @@ Gem::Specification.new do |spec|
33
33
  spec.add_development_dependency "awesome_print"
34
34
  spec.add_development_dependency "bundler", "~> 2.0"
35
35
  spec.add_development_dependency "byebug"
36
+ spec.add_development_dependency "coveralls", ">= 0.7.0"
36
37
  spec.add_development_dependency "rake", "~> 10.0"
37
38
  spec.add_development_dependency "redis"
38
39
  spec.add_development_dependency "rspec", "~> 3.0"
data/lib/clustered_rpc.rb CHANGED
@@ -42,6 +42,7 @@ module ClusteredRpc
42
42
 
43
43
 
44
44
  def self.config(force=false, &block)
45
+ @@transport = nil
45
46
  block.call(self)
46
47
  @@instance_id ||= SecureRandom.hex(5)
47
48
  ensure_transport
@@ -27,6 +27,8 @@ module ClusteredRpc
27
27
  if @subscriber_thread
28
28
  ClusteredRpc.logger.warn "ClusteredRpc: killing subscriber thread"
29
29
  @subscriber_thread.kill
30
+ # https://stackoverflow.com/questions/49490278/wait-for-a-thread-to-die-in-ruby
31
+ sleep 0.01 while @subscriber_thread.alive?
30
32
  @redis_subscriber = nil
31
33
  end
32
34
  connect
@@ -1,3 +1,3 @@
1
1
  module ClusteredRpc
2
- VERSION = "0.2.1"
2
+ VERSION = "0.3.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: clustered_rpc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - megalithtracers@gmail.com
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-05-03 00:00:00.000000000 Z
11
+ date: 2021-05-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -66,6 +66,20 @@ dependencies:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: coveralls
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: 0.7.0
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: 0.7.0
69
83
  - !ruby/object:Gem::Dependency
70
84
  name: rake
71
85
  requirement: !ruby/object:Gem::Requirement
@@ -130,6 +144,7 @@ executables: []
130
144
  extensions: []
131
145
  extra_rdoc_files: []
132
146
  files:
147
+ - ".github/workflows/ruby.yml"
133
148
  - ".rspec"
134
149
  - ".travis.yml"
135
150
  - Gemfile