From antonoussik at gmail.com Wed Dec 2 04:09:09 2015 From: antonoussik at gmail.com (Anton Oussik) Date: Wed, 02 Dec 2015 12:09:09 +0000 Subject: [Southampton-pm] Perl Mongers meetup Message-ID: Will happen tonight at the platform tavern, I plan to be there from around 7. Hope to discuss the upcoming workshop and Perl 6. See you there! -------------- next part -------------- An HTML attachment was scrubbed... URL: From i.campbell at mac.com Wed Dec 2 04:35:49 2015 From: i.campbell at mac.com (Iain Campbell) Date: Wed, 02 Dec 2015 12:35:49 +0000 Subject: [Southampton-pm] Perl Mongers meetup In-Reply-To: References: Message-ID: <121F69CB-BD45-4E2A-A8E1-603BEA801B49@mac.com> I may wander over, mate. I'll be in a fetching pink jumper and black jeans. You can't miss me. > On 2 Dec 2015, at 12:09, Anton Oussik wrote: > > Will happen tonight at the platform tavern, I plan to be there from around 7. Hope to discuss the upcoming workshop and Perl 6. See you there! > > _______________________________________________ > Southampton-pm mailing list > Southampton-pm at pm.org > http://mail.pm.org/mailman/listinfo/southampton-pm -------------- next part -------------- An HTML attachment was scrubbed... URL: From vytdau at gmail.com Wed Dec 2 04:47:48 2015 From: vytdau at gmail.com (Vytautas D) Date: Wed, 2 Dec 2015 12:47:48 +0000 Subject: [Southampton-pm] Perl Mongers meetup In-Reply-To: <121F69CB-BD45-4E2A-A8E1-603BEA801B49@mac.com> References: <121F69CB-BD45-4E2A-A8E1-603BEA801B49@mac.com> Message-ID: I should be there too :) On Wed, Dec 2, 2015 at 12:35 PM, Iain Campbell wrote: > I may wander over, mate. I'll be in a fetching pink jumper and black > jeans. You can't miss me. > > On 2 Dec 2015, at 12:09, Anton Oussik wrote: > > Will happen tonight at the platform tavern, I plan to be there from around > 7. Hope to discuss the upcoming workshop and Perl 6. See you there! > _______________________________________________ > Southampton-pm mailing list > Southampton-pm at pm.org > http://mail.pm.org/mailman/listinfo/southampton-pm > > > > _______________________________________________ > Southampton-pm mailing list > Southampton-pm at pm.org > http://mail.pm.org/mailman/listinfo/southampton-pm > -------------- next part -------------- An HTML attachment was scrubbed... URL: From duncan.garland at ntlworld.com Wed Dec 2 05:52:18 2015 From: duncan.garland at ntlworld.com (GARLAND DUNCAN) Date: Wed, 2 Dec 2015 13:52:18 +0000 (GMT) Subject: [Southampton-pm] Perl Mongers meetup In-Reply-To: References: Message-ID: <861162455.60692.1449064338689.JavaMail.open-xchange@oxbe2.tb.ukmail.iss.as9143.net> > On 02 December 2015 at 12:09 Anton Oussik wrote: > > > Will happen tonight at the platform tavern, I plan to be there from around > 7. Hope to discuss the upcoming workshop and Perl 6. See you there! > _______________________________________________ > Southampton-pm mailing list > Southampton-pm at pm.org > http://mail.pm.org/mailman/listinfo/southampton-pm I'll be there From vytdau at gmail.com Wed Dec 2 12:07:23 2015 From: vytdau at gmail.com (Vytautas D) Date: Wed, 2 Dec 2015 20:07:23 +0000 Subject: [Southampton-pm] Perl Mongers meetup In-Reply-To: <861162455.60692.1449064338689.JavaMail.open-xchange@oxbe2.tb.ukmail.iss.as9143.net> References: <861162455.60692.1449064338689.JavaMail.open-xchange@oxbe2.tb.ukmail.iss.as9143.net> Message-ID: Warning to anyone coming - it took me 20mins to find a parking... On 2 Dec 2015 13:52, "GARLAND DUNCAN" wrote: > > > > On 02 December 2015 at 12:09 Anton Oussik wrote: > > > > > > Will happen tonight at the platform tavern, I plan to be there from > around > > 7. Hope to discuss the upcoming workshop and Perl 6. See you there! > > _______________________________________________ > > Southampton-pm mailing list > > Southampton-pm at pm.org > > http://mail.pm.org/mailman/listinfo/southampton-pm > > > I'll be there > _______________________________________________ > Southampton-pm mailing list > Southampton-pm at pm.org > http://mail.pm.org/mailman/listinfo/southampton-pm > -------------- next part -------------- An HTML attachment was scrubbed... URL: From vytdau at gmail.com Thu Dec 3 05:56:56 2015 From: vytdau at gmail.com (Vytautas D) Date: Thu, 3 Dec 2015 13:56:56 +0000 Subject: [Southampton-pm] Perl Mongers meetup In-Reply-To: References: <861162455.60692.1449064338689.JavaMail.open-xchange@oxbe2.tb.ukmail.iss.as9143.net> Message-ID: Iain, See dummy Coro example, hopefully code is self explanatory. Here are two forever loops, and they cede automatically on blocking calls i.e. sleep and rouse_wait. #!/usr/bin/perl use 5.14.0; use warnings; use Coro; use Coro::AnyEvent; use AnyEvent; use AnyEvent::HTTP; $AnyEvent::HTTP::MAX_PER_HOST = 10; # Some dummy stats my $s = 0; # succeeded my $f = 0; # failed my $round = 0; # Track time passed my $start = AnyEvent->now(); my $watcher = Coro::async{ while(1) { Coro::AnyEvent::sleep( 5 ); my $end = AnyEvent->now(); my $lasted = $end - $start; say "s/f: $s/$f in $lasted, ", ($s+$f)/$lasted, "req/s"; # reset stats $s = 0; $f = 0; # reset start time $start = $end; } }; while (1) { my $cb = Coro::rouse_cb(); AnyEvent::HTTP::http_request( GET => "http://google.com", "persistent" => "1", "keepalive" => "1", $cb, ); my ( $body, $hdr ) = Coro::rouse_wait($cb); if ( $hdr->{Status} =~ /^2/ ) { $s++; } else { $f++; } } On Wed, Dec 2, 2015 at 8:07 PM, Vytautas D wrote: > Warning to anyone coming - it took me 20mins to find a parking... > > On 2 Dec 2015 13:52, "GARLAND DUNCAN" wrote: >> >> >> >> > On 02 December 2015 at 12:09 Anton Oussik wrote: >> > >> > >> > Will happen tonight at the platform tavern, I plan to be there from >> > around >> > 7. Hope to discuss the upcoming workshop and Perl 6. See you there! >> > _______________________________________________ >> > Southampton-pm mailing list >> > Southampton-pm at pm.org >> > http://mail.pm.org/mailman/listinfo/southampton-pm >> >> >> I'll be there >> _______________________________________________ >> Southampton-pm mailing list >> Southampton-pm at pm.org >> http://mail.pm.org/mailman/listinfo/southampton-pm From i.campbell at mac.com Thu Dec 3 07:09:44 2015 From: i.campbell at mac.com (Iain Campbell) Date: Thu, 03 Dec 2015 15:09:44 +0000 Subject: [Southampton-pm] Perl Mongers meetup In-Reply-To: References: <861162455.60692.1449064338689.JavaMail.open-xchange@oxbe2.tb.ukmail.iss.as9143.net> Message-ID: Thanks, mate. I?ll have a tinker about with this and come back with a barrage of questions, no doubt. :) > On 3 Dec 2015, at 13:56, Vytautas D wrote: > > Iain, > See dummy Coro example, hopefully code is self explanatory. Here are > two forever loops, and they cede automatically on blocking calls i.e. > sleep and rouse_wait. > > #!/usr/bin/perl > > use 5.14.0; > use warnings; > > use Coro; > use Coro::AnyEvent; > use AnyEvent; > use AnyEvent::HTTP; > > $AnyEvent::HTTP::MAX_PER_HOST = 10; > > # Some dummy stats > my $s = 0; # succeeded > my $f = 0; # failed > my $round = 0; > > # Track time passed > my $start = AnyEvent->now(); > > my $watcher = Coro::async{ > while(1) { > Coro::AnyEvent::sleep( 5 ); > my $end = AnyEvent->now(); > my $lasted = $end - $start; > > say "s/f: $s/$f in $lasted, ", ($s+$f)/$lasted, "req/s"; > > # reset stats > $s = 0; > $f = 0; > > # reset start time > $start = $end; > } > }; > > while (1) { > my $cb = Coro::rouse_cb(); > AnyEvent::HTTP::http_request( > GET => "http://google.com", > "persistent" => "1", > "keepalive" => "1", > $cb, > ); > my ( $body, $hdr ) = Coro::rouse_wait($cb); > > if ( $hdr->{Status} =~ /^2/ ) { > $s++; > } else { > $f++; > } > } > > On Wed, Dec 2, 2015 at 8:07 PM, Vytautas D wrote: >> Warning to anyone coming - it took me 20mins to find a parking... >> >> On 2 Dec 2015 13:52, "GARLAND DUNCAN" wrote: >>> >>> >>> >>>> On 02 December 2015 at 12:09 Anton Oussik wrote: >>>> >>>> >>>> Will happen tonight at the platform tavern, I plan to be there from >>>> around >>>> 7. Hope to discuss the upcoming workshop and Perl 6. See you there! >>>> _______________________________________________ >>>> Southampton-pm mailing list >>>> Southampton-pm at pm.org >>>> http://mail.pm.org/mailman/listinfo/southampton-pm >>> >>> >>> I'll be there >>> _______________________________________________ >>> Southampton-pm mailing list >>> Southampton-pm at pm.org >>> http://mail.pm.org/mailman/listinfo/southampton-pm > _______________________________________________ > Southampton-pm mailing list > Southampton-pm at pm.org > http://mail.pm.org/mailman/listinfo/southampton-pm