arya-pandemic 0.4.8 → 0.4.9

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -2,7 +2,7 @@ require 'rubygems'
2
2
  require 'rake'
3
3
  require 'echoe'
4
4
 
5
- Echoe.new('pandemic', '0.4.8') do |p|
5
+ Echoe.new('pandemic', '0.4.9') do |p|
6
6
  p.description = "A framework for distributing work for real-time services and offline tasks."
7
7
  p.url = "https://github.com/arya/pandemic/"
8
8
  p.author = "Arya Asemanfar"
@@ -7,7 +7,6 @@ module Pandemic
7
7
  class NodeTimedOut < StandardError; end
8
8
  class RequestFailed < StandardError; end
9
9
 
10
-
11
10
  include Util
12
11
  def initialize
13
12
  Config.load
@@ -71,6 +70,11 @@ module Pandemic
71
70
  end
72
71
  end
73
72
 
73
+ def shutdown
74
+ @connections.each {|c| c.socket.close if c.alive? }
75
+ @maintain_minimum_connections_thread.kill if @maintain_minimum_connections_thread
76
+ end
77
+
74
78
  private
75
79
  def with_connection(key, &block)
76
80
  connection = nil
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{pandemic}
5
- s.version = "0.4.8"
5
+ s.version = "0.4.9"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Arya Asemanfar"]
@@ -6,7 +6,6 @@ class FunctionalTest < Test::Unit::TestCase
6
6
  ignore_threads = Thread.list
7
7
  ARGV.replace(["-i", "0", "-c", "test/pandemic_server.yml"]) # :(
8
8
  Pandemic::ClientSide::Config.config_path = "test/pandemic_client.yml"
9
-
10
9
  server = epidemic!
11
10
  server.handler = Class.new(Pandemic::ServerSide::Handler) do
12
11
  def process(body)
@@ -20,6 +19,7 @@ class FunctionalTest < Test::Unit::TestCase
20
19
  end.new
21
20
  client.extend(Pandemize)
22
21
  assert_equal "dlrow olleh", client.pandemic.request("hello world")
22
+ client.pandemic.shutdown
23
23
  server.stop
24
24
  wait_for_threads(ignore_threads)
25
25
  end
@@ -49,6 +49,7 @@ class FunctionalTest < Test::Unit::TestCase
49
49
  end.new
50
50
  client.extend(Pandemize)
51
51
  assert_equal "raboofraboof", client.pandemic.request("foobar")
52
+ client.pandemic.shutdown
52
53
  server.stop
53
54
  server2.stop
54
55
  wait_for_threads(ignore_threads)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: arya-pandemic
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.8
4
+ version: 0.4.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arya Asemanfar