* io.c (rb_open_file): encoding in mode string was ignored if perm is
[ruby-svn.git] / sample / drb / dhasen.rb
blobfb1724afa312ca079cc0f778e74203f3320973dd
1 =begin
2  distributed Ruby --- dRuby Sample Server --- chasen server
3         Copyright (c) 1999-2001 Masatoshi SEKI 
4 =end
6 =begin
7  How to play.
9  Terminal 1
10  | % ruby dhasen.rb 
11  | druby://yourhost:7640
13  Terminal 2
14  | % ruby dhasenc.rb druby://yourhost:7640
16 =end
18 require 'drb/drb'
19 require 'chasen'
20 require 'thread'
22 class Dhasen
23   include DRbUndumped
25   def initialize
26     @mutex = Mutex.new
27   end
29   def sparse(str, *arg)
30     @mutex.synchronize do
31       Chasen.getopt(*arg)
32       Chasen.sparse(str)
33     end
34   end
35 end
37 if __FILE__ == $0
38   DRb.start_service(nil, Dhasen.new)
39   puts DRb.uri
40   DRb.thread.join
41 end