Re: [PBML] Web Application need to call a perl program.
- Hi Schwartz.
Thank you very much for your timely help!!.
I had gone through the POE docs. Since I am very new to the CGI please
excuse me if I am asking a wrong question. I am not able to create the
scripts as I am confused and stuck up in the design phase itself. Since http
is a stateless transfer protocol, how can POE hold the http request
Well, there are two ways, as I said in the previous note:
browser -HTTP-> light CGI -HTTP-> POE Daemon -forking-> tasks
browser -HTTP-> POE Daemon -forking-> tasks
The first involves creating a CGI script that gathers and validates the
parameters, then uses LWP::Simple to talk to the POE Daemon to actually post
the request or fetch the status.
With reference your first suggestion, I think, the http page is transferring
data to CGI using POST method. But once the submissions are over how can the
web page get result from the CGI? As you said, LWP::Simple can get the
values from the request. But I am querying some database and doing
calculations, the response time can vary, say duration of 5 minutes. Will
the module hold it for that time?
The second is a bit simpler, but would require some way for the browser to
find the POE daemon's URL, perhaps linked from a main server's page, and you
don't want a complicated page to deliver to the browser.
Also, I am confused, how to communicate between lwp and the daemon. Can we
get the status, like how many child processes are currently running on the
server?. If the request exceeds how can we queue up the request?. Do we need
file or database operations since there are chances for the user at http end
to close the browsing window or losing a network connection?
And yes, POE is a general framework, and everything you're asking can be
done in a straightforward way.
Since each request from LWP to daemon is a new connection how can we call
the daemon, since daemon will be an independent service, do we need any
socket connection for that?. Please advice.
Please correct me if I am having a wrong understanding on this. I am not
able to proceed with the design as I am not clear with the underlying
processes and concepts.
Also could you please send me links that describes POE operations with
example, if you have any. Your guidance is highly appreciated. Once again,
thanks a lot!!
Have a Nice day!
Thanks and Regards
[Non-text portions of this message have been removed]