How to get DRb and Webrick to work together?

S

Sal Syed

Hi,
I'm trying to run Webrick and DRb on the same program. I run them on
different ports. The problem is they both try to take over the entire
process


$user[:drbserver]=DistributedSearch.new($user,$database)
DRb.start_service("druby://localhost:#{$config[:drbport]}",$user[:drbserver])

puts "Starting server process"
# Start the server thread.
server.start

The following code stops and I never get to start the webserver.

Can someone help? I'm new to ruby not sure how to set these up to run in
their own threads properly.
 
M

Michael Linfield

Sal said:
Hi,
I'm trying to run Webrick and DRb on the same program. I run them on
different ports. The problem is they both try to take over the entire
process


$user[:drbserver]=DistributedSearch.new($user,$database)
DRb.start_service("druby://localhost:#{$config[:drbport]}",$user[:drbserver])

puts "Starting server process"
# Start the server thread.
server.start

The following code stops and I never get to start the webserver.

service=DRb.start_service("druby://localhost:#{$config[:drbport]}",$user[:drbserver])

Thread.new do
while service != nil
server.start
end

Worth giving a shot....Also you might want to google 'Ruby
multithreading' for more info on the subject.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top