pthread 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -22,7 +22,7 @@ Or install it yourself as:
22
22
 
23
23
  Before using parallel threads you should configure a dRb server:
24
24
 
25
- Pthread::Pthread.start_service 'localhost:12345'
25
+ Pthread::Pthread.start_service 'localhost:12345'
26
26
 
27
27
  Pthreads are actual Unix processes. You can add process-workers on the same machine as the main programm by calling:
28
28
 
@@ -22,10 +22,10 @@ class Pthread::Pthread
22
22
  end
23
23
 
24
24
  def initialize(job)
25
- @@ts.write(["#{self.object_id}_s", job[:queue], job[:code], job[:context]])
25
+ @@ts.write([self.object_id, job[:queue], job[:code], job[:context]])
26
26
  end
27
27
 
28
28
  def value
29
- @@ts.take(["#{self.object_id}_r", nil])[1]
29
+ @@ts.take([self.object_id, nil])[1]
30
30
  end
31
31
  end
@@ -6,14 +6,14 @@ class Pthread::PthreadExecutor
6
6
  ts = DRbObject.new_with_uri("druby://#{host}")
7
7
 
8
8
  loop do
9
- pthread_id, _, code, context = ts.take([ /_s/, queue, nil, nil])
9
+ pthread_id, _, code, context = ts.take([nil, queue, nil, nil])
10
10
 
11
11
  context && context.each do |a, v|
12
12
  singleton_class.class_eval { attr_accessor a }
13
13
  self.send("#{a}=", context[a])
14
14
  end
15
15
 
16
- ts.write(["#{pthread_id[0..-3]}_r", eval(code)])
16
+ ts.write([pthread_id, eval(code)])
17
17
  end
18
18
  rescue DRb::DRbConnError
19
19
  exit 0
@@ -1,3 +1,3 @@
1
1
  module Pthread
2
- VERSION = '0.0.2'
2
+ VERSION = '0.0.3'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pthread
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: