pb_actor 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/pb_actor/basic_proxy.rb +3 -4
- data/lib/pb_actor/message.rb +2 -0
- data/lib/pb_actor/version.rb +1 -1
- data/spec/message_spec.rb +23 -0
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ed926fafad75713c566df0ac82704631c29ecff0
|
4
|
+
data.tar.gz: 7d74986b42da2262ba4dc3a04d3786a47996c2e0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a1268f95cb59df589117fad9822cf02c433c1cd1ffb611ead131377aecaf97def664979f60d2725a61f4f46f9dab17524f44e469912d0e525970eda6bc4b5fc0
|
7
|
+
data.tar.gz: f6d686f57c195f8ab3cd6400163b6905402df5b31b1a1b2f8b42b2af413a943e34b98c018b935e3c942761b7b0608cf42eb790e55560524fd69613a495dfba87
|
data/lib/pb_actor/basic_proxy.rb
CHANGED
@@ -7,10 +7,9 @@ module PbActor
|
|
7
7
|
end
|
8
8
|
|
9
9
|
def alive?
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
true
|
10
|
+
!Process.waitpid @pid, Process::WNOHANG
|
11
|
+
rescue Errno::ECHILD => e
|
12
|
+
false
|
14
13
|
end
|
15
14
|
|
16
15
|
def method_missing method, *args, &blk
|
data/lib/pb_actor/message.rb
CHANGED
data/lib/pb_actor/version.rb
CHANGED
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe PbActor::Message do
|
4
|
+
before :each do
|
5
|
+
@r, @w = IO.pipe
|
6
|
+
end
|
7
|
+
|
8
|
+
after :each do
|
9
|
+
[@r, @w].each do |io|
|
10
|
+
io.close unless io.closed?
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
it 'send should broken when read io close' do
|
15
|
+
@r.close
|
16
|
+
expect{PbActor::Message.send "message", @w}.to raise_error(PbActor::DeadActorError)
|
17
|
+
end
|
18
|
+
|
19
|
+
it 'recv should broken when write io close' do
|
20
|
+
@w.close
|
21
|
+
expect{PbActor::Message.recv @r}.to raise_error(PbActor::DeadActorError)
|
22
|
+
end
|
23
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pb_actor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- jjy
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-08-
|
11
|
+
date: 2013-08-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -59,6 +59,7 @@ files:
|
|
59
59
|
- lib/pb_actor/proxy.rb
|
60
60
|
- lib/pb_actor/version.rb
|
61
61
|
- pb_actor.gemspec
|
62
|
+
- spec/message_spec.rb
|
62
63
|
- spec/pb_actor_spec.rb
|
63
64
|
- spec/spec_helper.rb
|
64
65
|
homepage: https://github.com/jjyr/pb_actor
|
@@ -81,10 +82,11 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
81
82
|
version: '0'
|
82
83
|
requirements: []
|
83
84
|
rubyforge_project:
|
84
|
-
rubygems_version: 2.0.
|
85
|
+
rubygems_version: 2.0.6
|
85
86
|
signing_key:
|
86
87
|
specification_version: 4
|
87
88
|
summary: Just for fun.
|
88
89
|
test_files:
|
90
|
+
- spec/message_spec.rb
|
89
91
|
- spec/pb_actor_spec.rb
|
90
92
|
- spec/spec_helper.rb
|