Solved

Perl create thread for instant soap request response

Posted on 2006-12-01
3
383 Views
Last Modified: 2008-01-09
I have a situation where I am using Perl and SOAP::Lite to build a system of multiple machines and multiple layers of communication. Now I am running into a scalability issue that I did not forsee. In certian cases of this communication I want to send a request and I dont want to wait for a response. Now I know that is a limitation at several levels http, soap, and perl. But what I am thinking of doing is on certian requests I want to spawn a thread to respond with a status of 0 but have my service continue processing the request. Right now it looks something like this

client (sends request to process log) -> server (processes log)
client <- server (sends response when completed)

What I want is
client (sends request to process log) -> server
client <- server (responds with return value right away)
server (processes log and doesnt send any further notice to anyone)

My server is actually a soap service as a cgi script on apache. Now I have never used fork or threads and I am wondering how I should design my service to deal with that. I know there are a bunch of issues with sharing objects and memory. But I think I should be able to avoid most of those because I only need to spawn 1 thread or fork to either return a value to the soap client or to process the log and let the main script return a value.

I am thinking a fork might not be the best thing because it looks like its a copy of the whole script and I dont know if I want to do that. And I dont think it would be able to know about that session or variables passed into that would it?
0
Comment
Question by:amesdaq
3 Comments
 
LVL 84

Accepted Solution

by:
ozo earned 250 total points
ID: 18055870
see the  multithreaded server example in
perldoc perlipc
0

Featured Post

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many situations when we need to display the data in sorted order. For example: Student details by name or by rank or by total marks etc. If you are working on data driven based projects then you will use sorting techniques very frequently.…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

832 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question