repo.or.cz
/
ruby-svn.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
history
|
raw
|
HEAD
* io.c (rb_open_file): encoding in mode string was ignored if perm is
[ruby-svn.git]
/
sample
/
drb
/
dhasen.rb
blob
fb1724afa312ca079cc0f778e74203f3320973dd
1
=begin
2
distributed Ruby --- dRuby Sample Server --- chasen server
3
Copyright (c) 1999-2001 Masatoshi SEKI
4
=end
5
6
=begin
7
How to play.
8
9
Terminal 1
10
| % ruby dhasen.rb
11
| druby://yourhost:7640
12
13
Terminal 2
14
| % ruby dhasenc.rb druby://yourhost:7640
15
16
=end
17
18
require 'drb/drb'
19
require 'chasen'
20
require 'thread'
21
22
class Dhasen
23
include DRbUndumped
24
25
def initialize
26
@mutex = Mutex.new
27
end
28
29
def sparse(str, *arg)
30
@mutex.synchronize do
31
Chasen.getopt(*arg)
32
Chasen.sparse(str)
33
end
34
end
35
end
36
37
if __FILE__ == $0
38
DRb.start_service(nil, Dhasen.new)
39
puts DRb.uri
40
DRb.thread.join
41
end
42