473,390 Members | 1,399 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,390 software developers and data experts.

Asynchronous http request

In a Perl script I want to send several http requests WITHOUT waiting
for the remote servers answer (i.e. just triggering http requests) and
without having to create lots of processes...

Thanks in advance

François-Xavier
Jul 19 '05 #1
3 8304
fx@testard-vaillant.com (Fran?ois-Xavier Testard-Vaillant) wrote in message news:<b2**************************@posting.google. com>...
In a Perl script I want to send several http requests WITHOUT waiting
for the remote servers answer (i.e. just triggering http requests) and
without having to create lots of processes...


Have you tried LWP::Paralell?

This newsgroup does not exist (see FAQ). Please do not start threads here.
Jul 19 '05 #2
> Have you tried LWP::Paralell?

As far as I understand LWP::Paralell it allows me to paralellize
several HTTP requests, i.e. not waiting for the end of the first one
to send the second one and so on.
What I need is to send a bunch of requests and leave, not waiting for
the results and not killing them.
The only way I found to do this is to fork the current process and
kill the father. But due to what I want to do (propagation in a
graph), it could create a lot of processes.

fxtv
Jul 19 '05 #3
fx@testard-vaillant.com (Fran?ois-Xavier Testard-Vaillant) wrote in message news:<b2************************@posting.google.co m>...
Have you tried LWP::Paralell?


As far as I understand LWP::Paralell it allows me to paralellize
several HTTP requests, i.e. not waiting for the end of the first one
to send the second one and so on.
What I need is to send a bunch of requests and leave, not waiting for
the results and not killing them.
The only way I found to do this is to fork the current process and
kill the father. But due to what I want to do (propagation in a
graph), it could create a lot of processes.

fxtv

- use a very short timeout?/tweak LWP to have a 0 timeout
or
use a typical LWP::UserAgent request, but disable the read
from the connected socket after the http request was
transmitted in LWP/Protocol/http.pm @ (yep, need to change the LWP
code, its a shame!)

# read response line from server
LWP::Debug::debug('reading response');

I guess a statement like return HTTP::Response->new()
might work,right after the debug print, but you need
to sort it out for yourself.

Don't know what the effects are perhaps all kind of tcp/ip
buffers will overflow (get flusshed if you die).

getting the request data back would require splitting the
sender and reciever parts into two threads (1 fork), or another
trick would be to start reading after the 2nd request, getting
the results back from the 1st request (or even wait N requests
before starting to read to circumvent tcp/ip buffer overlflows).

I guess I'm redoing LWP::Paralell (in a singletrheaded model)
(or is it the same, duno, never seen it,used it,sorry)

b2w there are easier ways to dump lots data in tcp/ip ports like 80
, see perldoc -f socket and send.
Jul 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Marty McDonald | last post by:
I create and start several threads, each thread executes the same method - within the method, a web service is invoked. I find that the more threads I use, the longer it takes for all of the...
3
by: Thomas Nielsen | last post by:
Hi, I need to make a web page that wait for 3 asynchronous processes to finish. So I am considering these options 1) Poll the status of the processes from the web page using the "REFRESH"...
1
by: Julian Hershel | last post by:
Reading about asynchronous programming (ms-help://MS.NETFrameworkSDK/cpguidenf/html/cpconasynchronousdesignpatterno verview.htm) I could not clarify some doubts. Hope you can help me. 1) Are...
5
by: archana | last post by:
Hi all i am having application which is using asychronous web request. At a time i am processing 5 urls asynchronously. Application working properly for 5 asynchronous call. But sometimes CPU...
2
by: archana | last post by:
Hi all, I am processing asynchronous web request with setting timeout using RegisterWaitForSingleObject. On beginwebrequest i am sending address of one callback which i want to execute when...
0
by: Bishoy George | last post by:
Hi, I have a asp.net 2.0 web application. I want to implement the asynchronous model through http handler in web.config ...
4
by: Engineerik | last post by:
I am trying to create a socket server which will listen for connections from multiple clients and call subroutines in a Fortran DLL and pass the results back to the client. The asynchronous socket...
4
by: MaxMax | last post by:
I'm using HttpWebRequest. It seems that all the callback called from HttpWebRequest are in another thread (not in the "original" thread). Now my problem is that the "original" thread is the thread...
4
by: Morgan Cheng | last post by:
Since ASP.NET 2.0, asynchronous web service client can be implemented with event-based pattern, instead of original BeginXXX/EndXXX pattern. However, I didn't find any material about event-based...
1
by: sindhurasingeetham | last post by:
Hi, I'm new to coding in .NET. I am trying to do an asynchronous call in my code using httpwebrequest. This code works perfectly fine on one server, but does not work on another. The main flow...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.