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

5762Sending return value to soap client without returning from sub { ... }

Expand Messages
  • h_emre_k
    Dec 23, 2006
    • 0 Attachment

      I wrote a small daemon that receives some index value via SOAP and
      does further time consuming things based on the value.

      The SOAP client is supposed not to care if the further actions are
      sucessfull and it should not wait for the time consuming part to finish.

      Is there any way to send a SOAP result to the client while still
      "staying" in the context of the subroutine/method?

      Right now I have something like this:

      my $soap = SOAP::Lite
      -> on_fault(sub{})
      -> uri($uri)
      -> proxy($proxy);

      my $index = "123";
      my $result = $soap->doSomething($index);

      my $daemon = SOAP::Transport::HTTP::Daemon
      -> new (LocalAddr => $host, LocalPort => $port, Reuse => 1)
      -> dispatch_to('FOO');


      package FOO;

      sub doSomething {
      my $par = shift;

      What would be the appropriate way to send a return value to client and
      keep processing $par?

      I did some searching in this group and read some messages regarding
      asynchronous messaging. It seemed an overkill to me implementing some
      kind of task tracking system as I really do not care about the actual
      result of doSomething();. Most examples also seem to be using the SOAP
      daemon within an Apache context, which is not what I am using.

      I´m kind of lost so any hint will be greatly appreciated :)


    • Show all 3 messages in this topic