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
      Hi,

      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:

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

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

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

      $daemon->handle;

      package FOO;

      sub doSomething {
      my $par = shift;
      doTimeConsumingStuff($par);
      return;
      }

      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 :)

      Thanks,

      Emre
    • Show all 3 messages in this topic