How to get DRb and Webrick to work together?

Discussion in 'Ruby' started by Sal Syed, Sep 1, 2007.

  1. Sal Syed

    Sal Syed Guest

    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.
    --
    Posted via http://www.ruby-forum.com/.
    Sal Syed, Sep 1, 2007
    #1
    1. Advertising

  2. Sal Syed wrote:
    > 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.
    --
    Posted via http://www.ruby-forum.com/.
    Michael Linfield, Sep 1, 2007
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Miles Keaton
    Replies:
    3
    Views:
    174
    Miles Keaton
    Mar 30, 2005
  2. Kirk Haines

    More DRb; SSL & DRB & errors

    Kirk Haines, Jul 1, 2005, in forum: Ruby
    Replies:
    0
    Views:
    118
    Kirk Haines
    Jul 1, 2005
  3. Aaron Smith

    WEBrick::Daemon and WEBrick

    Aaron Smith, Mar 9, 2007, in forum: Ruby
    Replies:
    2
    Views:
    301
    Aaron Smith
    Mar 18, 2007
  4. J. Wook
    Replies:
    16
    Views:
    273
    Robert Klemme
    May 16, 2007
  5. Ittay Dror
    Replies:
    1
    Views:
    124
    Ittay Dror
    Oct 21, 2008
Loading...

Share This Page