Testing concurrent tasks / forking
Robbie Bow
robbie at robbiebow.co.uk
Sun Dec 23 12:46:47 PST 2007
-------- Original Message --------
Subject: Re:Testing concurrent tasks / forking
From: Tom Hukins <tom at eborcom.com>
To: Milton Keynes Perl Mongers <miltonkeynes-pm at pm.org>
Date: 23 December 2007 17:57:21
> On Sun, Dec 23, 2007 at 01:05:20PM +0000, abhishek jain wrote:
>> So you are interested in to running several concurrent requests at a
>> time, i suggest u look at POE .
>
> I've never quite got my head round POE. I find HTTP::Async
> considerably easier to use. But both these approaches might require
> writing a fair amount of code, depending on what Robbie wants to do
That looks easier to use. I played with POE, trying to mix it with
Test::WWW::Mechanize but am not convinced the end result was making
concurrent connections. Here's an example of what I came up with:
http://paste.husk.org/10587
The POE responses look to be coming back in the order they were sent,
and take about the same time as the simple serial fetches. Even when I
wrote a wee script to fetch that adds a nanosleep to each response and
runs under FastCGI (see http://paste.husk.org/10586), the response all
appear to come back in order sent.
HTTP::Async looks easier to use, but I'm not seeing a way to add CGI
POST variables. I'll have a play anyway. My ideal situation will be to
able to simulate several users submitting the same form to the web
server at the same time, if that makes sense.
PS.http://www.robbiebow.co.uk/cgi-bin/sleepy.pl is dead. Long live
http://www.robbiebow.co.uk/cgi-bin/sleepy.fcgi
More information about the MiltonKeynes-pm
mailing list