Loading ...
Sorry, an error occurred while loading the content.

SOAP::Transport::HTTP::Daemon handle() sub ...

Expand Messages
  • John Michael Zorko
    Hello, all ... I need to be able to have SOAP servers that are able to do other things while waiting for SOAP calls. Yet, the handle() method for the
    Message 1 of 3 , Dec 30, 2004
    • 0 Attachment
      Hello, all ...

      I need to be able to have SOAP servers that are able to do other things while waiting for
      SOAP calls. Yet, the handle() method for the SOAP::Transport::HTTP::Daemon waits on
      accept() and doesn't come back, in effect stopping the server from doing anything else
      until a SOAP call arrives. Instead of:

      $server->handle;

      I want:

      while ( $server->handle )
      {
      do_something_else();
      }

      ... yet I still want to run the server standalone (Transport::Daemon). My questions are:

      1. Is there something easy that I can do without subclassing SOAP::Transport::HTTP::
      Daemon? Forking a process that acted as a client to itself and calling a SOAP method to
      do_something_else() is out -- I tried that, and it worked, but it's just _so_ nasty and opens
      up all kinds of other possible bad things ...

      2. If no, then I want to use select() (or IO::Select()) to override the handle() method to make
      it non-blocking. Any insight on how to do this?

      Regards,

      John

      Falling You - exploring the beauty of voice and sound
      http://www.magnatune.com/artists/falling_you
    • Mike Schroeder
      If you aren t familiar with POE, consider using it. Worst case, you can probably scavenge some code from the POE module that does what you are asking for:
      Message 2 of 3 , Dec 30, 2004
      • 0 Attachment
        If you aren't familiar with POE, consider using it.

        Worst case, you can probably scavenge some code from the POE module that
        does what you are asking for:

        http://search.cpan.org/~apocal/POE-Component-Server-SOAP-1.06/lib/POE/Component/Server/SOAP.pm


        John Michael Zorko wrote:

        >
        >Hello, all ...
        >
        >I need to be able to have SOAP servers that are able to do other things while waiting for
        >SOAP calls. Yet, the handle() method for the SOAP::Transport::HTTP::Daemon waits on
        >accept() and doesn't come back, in effect stopping the server from doing anything else
        >until a SOAP call arrives. Instead of:
        >
        >$server->handle;
        >
        >I want:
        >
        >while ( $server->handle )
        >{
        > do_something_else();
        >}
        >
        >... yet I still want to run the server standalone (Transport::Daemon). My questions are:
        >
        >1. Is there something easy that I can do without subclassing SOAP::Transport::HTTP::
        >Daemon? Forking a process that acted as a client to itself and calling a SOAP method to
        >do_something_else() is out -- I tried that, and it worked, but it's just _so_ nasty and opens
        >up all kinds of other possible bad things ...
        >
        >2. If no, then I want to use select() (or IO::Select()) to override the handle() method to make
        >it non-blocking. Any insight on how to do this?
        >
        >Regards,
        >
        >John
        >
        >Falling You - exploring the beauty of voice and sound
        >http://www.magnatune.com/artists/falling_you
        >
        >
        >
        >
        >
        >
        >
        >
        >
        >
        >
        >Yahoo! Groups Links
        >
        >
        >
        >
        >
        >
        >
        >
        >
      • Alasdair Allan
        ... No, but that s pretty easy to do... ... How about threads then? See, http://www.astro.ex.ac.uk/people/aa/pages/computing/cookie_daemon.html Al.
        Message 3 of 3 , Jan 3, 2005
        • 0 Attachment
          John Michael Zorko wrote:
          > 1. Is there something easy that I can do without subclassing
          > SOAP::Transport::HTTP::
          > Daemon?

          No, but that's pretty easy to do...

          > Forking a process that acted as a client to itself and calling a SOAP
          > method to
          > do_something_else() is out -- I tried that, and it worked, but it's
          > just _so_ nasty and opens
          > up all kinds of other possible bad things ...

          How about threads then? See,

          http://www.astro.ex.ac.uk/people/aa/pages/computing/cookie_daemon.html

          Al.
        Your message has been successfully submitted and would be delivered to recipients shortly.