pione 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/.gitignore +1 -0
- data/History.txt +7 -0
- data/example/DeferredChoice/DeferredChoice.pione +14 -7
- data/{misc → example/DeferredChoice/bin}/ui.xml +11 -6
- data/example/DeferredChoice/pione-package.json +1 -1
- data/example/DeferredChoiceWithPage/DeferredChoiceWithPage.pione +47 -0
- data/example/DeferredChoiceWithPage/etc/index.html +22 -0
- data/example/DeferredChoiceWithPage/pione-package.json +18 -0
- data/example/Interaction/Interaction.pione +27 -0
- data/example/Interaction/bin/show-environment.cgi +45 -0
- data/example/Interaction/etc/.hidden-file.txt +1 -0
- data/example/Interaction/etc/cgi.html +46 -0
- data/example/Interaction/etc/create-files.html +51 -0
- data/example/Interaction/etc/delete-files.html +31 -0
- data/example/Interaction/etc/get-files.html +21 -0
- data/example/Interaction/etc/index.html +18 -0
- data/example/Interaction/etc/list-files.html +36 -0
- data/example/Interaction/pione-package.json +24 -0
- data/lib/pione/agent/job-manager.rb +19 -3
- data/lib/pione/agent/logger.rb +9 -9
- data/lib/pione/agent/messenger.rb +3 -2
- data/lib/pione/agent/task-worker.rb +32 -10
- data/lib/pione/command/option.rb +18 -0
- data/lib/pione/command/pione-client.rb +51 -22
- data/lib/pione/command/pione-interactive.rb +128 -55
- data/lib/pione/command/pione-package-build.rb +3 -3
- data/lib/pione/command/pione-task-worker.rb +23 -10
- data/lib/pione/command/pione-tuple-space-provider.rb +8 -8
- data/lib/pione/command/spawner.rb +28 -1
- data/lib/pione/front/interactive-front.rb +76 -0
- data/lib/pione/global/interactive-variable.rb +26 -0
- data/lib/pione/log/message-log-receiver.rb +4 -2
- data/lib/pione/model/task-worker-broker-model.rb +7 -1
- data/lib/pione/package/package-archiver.rb +16 -9
- data/lib/pione/package/package-handler.rb +6 -0
- data/lib/pione/package/package-info.rb +4 -0
- data/lib/pione/package/package-reader.rb +2 -4
- data/lib/pione/package/package-scanner.rb +23 -3
- data/lib/pione/rule-engine.rb +48 -19
- data/lib/pione/rule-engine/action-handler.rb +29 -5
- data/lib/pione/rule-engine/basic-handler.rb +27 -19
- data/lib/pione/test-helper/command-helper.rb +1 -1
- data/lib/pione/tuple-space/tuple-definition.yml +2 -3
- data/lib/pione/tuple-space/tuple-space-server.rb +8 -0
- data/lib/pione/util/cgi.rb +326 -0
- data/lib/pione/version.rb +1 -1
- data/lib/rootage/normalizer.rb +4 -0
- data/lib/rootage/option.rb +11 -4
- data/test/agent/spec_logger.rb +0 -1
- data/test/agent/spec_messenger.rb +1 -1
- data/test/command/spec_pione-client.rb +4 -4
- data/test/log/spec_message-log.rb +1 -1
- data/test/rule-engine/spec_action-handler.rb +25 -5
- data/test/rule-engine/spec_empty-handler.rb +36 -3
- data/test/rule-engine/spec_flow-handler.rb +90 -7
- metadata +22 -72
- data/misc/test-drb-stop-service.rb +0 -34
- data/misc/test-many-waiters-client.rb +0 -56
- data/misc/test-many-waiters-server.rb +0 -14
@@ -1,34 +0,0 @@
|
|
1
|
-
require 'drb'
|
2
|
-
|
3
|
-
class TestService
|
4
|
-
include DRbUndumped
|
5
|
-
|
6
|
-
def test
|
7
|
-
"abc"
|
8
|
-
end
|
9
|
-
|
10
|
-
def pid
|
11
|
-
Process.pid
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
uri = "druby://localhost:33333"
|
16
|
-
|
17
|
-
pid1 = Process.fork do
|
18
|
-
puts "child: #{Process.pid}"
|
19
|
-
ts = TestService.new
|
20
|
-
DRb.start_service(uri, ts)
|
21
|
-
p ts.pid
|
22
|
-
sleep 10
|
23
|
-
Process.daemon
|
24
|
-
puts "aaaaaaaaaaaaaaaaaaaaa"
|
25
|
-
end
|
26
|
-
|
27
|
-
sleep 1
|
28
|
-
|
29
|
-
ref = DRbObject.new_with_uri(uri)
|
30
|
-
puts ref.pid
|
31
|
-
|
32
|
-
#DRb.remove_server(server)
|
33
|
-
sleep 1
|
34
|
-
|
@@ -1,56 +0,0 @@
|
|
1
|
-
require 'drb/drb'
|
2
|
-
require 'rinda/rinda'
|
3
|
-
|
4
|
-
Thread.abort_on_exception = true
|
5
|
-
|
6
|
-
module DRb
|
7
|
-
class DRbConn
|
8
|
-
@table = {}
|
9
|
-
def self.open(remote_uri) # :nodoc:
|
10
|
-
begin
|
11
|
-
conn = nil
|
12
|
-
|
13
|
-
@mutex.synchronize do
|
14
|
-
cache = @table[remote_uri]
|
15
|
-
if not(cache.nil?) && cache.alive?
|
16
|
-
conn = cache
|
17
|
-
else
|
18
|
-
puts "new"
|
19
|
-
cache.close unless cache.nil?
|
20
|
-
conn = self.new(remote_uri) unless conn
|
21
|
-
@table[remote_uri] = conn
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
succ, result = yield(conn)
|
26
|
-
return succ, result
|
27
|
-
|
28
|
-
ensure
|
29
|
-
if conn
|
30
|
-
if succ
|
31
|
-
puts "succ"
|
32
|
-
else
|
33
|
-
conn.close
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
|
-
DRb.start_service
|
42
|
-
|
43
|
-
ts = DRbObject.new_with_uri('druby://localhost:30000')
|
44
|
-
$count = 0
|
45
|
-
10000.times do
|
46
|
-
Thread.new do
|
47
|
-
$count += 1
|
48
|
-
ts.take([:a])
|
49
|
-
end
|
50
|
-
end
|
51
|
-
|
52
|
-
loop do
|
53
|
-
break if $count == 10000
|
54
|
-
puts $count
|
55
|
-
sleep 1
|
56
|
-
end
|
@@ -1,14 +0,0 @@
|
|
1
|
-
require 'drb/drb'
|
2
|
-
require 'rinda/rinda'
|
3
|
-
require 'rinda/tuplespace'
|
4
|
-
|
5
|
-
ts = Rinda::TupleSpace.new
|
6
|
-
DRb.start_service('druby://localhost:30000', ts)
|
7
|
-
Thread.new do
|
8
|
-
loop do
|
9
|
-
p DRb::DRbConn.instance_variable_get(:@pool)
|
10
|
-
sleep 1
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
DRb.thread.join
|