Solved

Perl create thread for instant soap request response

Posted on 2006-12-01
3
378 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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

I've just discovered very important differences between Windows an Unix formats in Perl,at least 5.xx.. MOST IMPORTANT: Use Unix file format while saving Your script. otherwise it will have ^M s or smth likely weird in the EOL, Then DO NOT use m…
Email validation in proper way is  very important validation required in any web pages. This code is self explainable except that Regular Expression which I used for pattern matching. I originally published as a thread on my website : http://www…
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…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

746 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now