noda 0.0.12 → 0.0.13
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.
- data/VERSION +1 -1
- data/lib/noda/job_worker.rb +17 -3
- data/noda.gemspec +1 -1
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.13
|
data/lib/noda/job_worker.rb
CHANGED
@@ -8,9 +8,23 @@ module Noda
|
|
8
8
|
# w=Noda::JobWorker.new("#{ip}", "10001")
|
9
9
|
# t = DRb.start_service("druby://#{ip}:10101",w)
|
10
10
|
# w.start
|
11
|
-
#
|
11
|
+
# Taskをサーバー経由で送信する
|
12
|
+
# ip=127.0.0.1
|
13
|
+
# server = Noda::JobServer.new ip,"10001"
|
14
|
+
# str = %Q'
|
15
|
+
# class Noda::MyTask
|
16
|
+
# def do_task(table)
|
17
|
+
# table.put @name, "#{Process.pid} : #{Time.now}"
|
18
|
+
# return "#{@name} in #{Process.pid} : #{Time.now}"
|
19
|
+
# end
|
20
|
+
# def initialize(name) @name end
|
21
|
+
# end
|
22
|
+
# '
|
23
|
+
# eval(str)
|
24
|
+
# task = Noda::MyTask.new("test")
|
25
|
+
# server.add_task_class( task.class.to_s, str)
|
26
|
+
# 10.times{|i| server.input.push Noda::MyTask.new(i) }
|
12
27
|
#
|
13
|
-
|
14
28
|
class JobWorker
|
15
29
|
attr_reader :thread
|
16
30
|
attr_accessor :max_retry_connect , :wait_time_to_retry
|
@@ -59,7 +73,7 @@ class JobWorker
|
|
59
73
|
# *name クラス名
|
60
74
|
def load_class(name)
|
61
75
|
s = @job.task_class(name)
|
62
|
-
Noda.module_eval(s)
|
76
|
+
Noda.module_eval(s) if s
|
63
77
|
end
|
64
78
|
# ワーカーのメインスレッドを起動します.start で使います.
|
65
79
|
def init_thread
|
data/noda.gemspec
CHANGED
metadata
CHANGED