Skip Menu |

This queue is for tickets about the AnyEvent-Pg CPAN distribution.

Report information
The Basics
Id: 95441
Status: rejected
Priority: 0/
Queue: AnyEvent-Pg

People
Owner: Nobody in particular
Requestors: rs [...] plusw.de
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Async Listen
Date: Wed, 7 May 2014 15:03:47 +0200
To: bug-AnyEvent-Pg [...] rt.cpan.org
From: Rolf Schaufelberger <rs [...] plusw.de>
Hello, I’ve just done a test with AnyEvent-Pg, yet I’m not sure if this is a bug or if just misunderstand the function. I took the code from example.pl and modified the on-notify callback from sub { say "foo!“ }); to sub { say "foo!", $_[3]; sleep 5; say 'Finished',$_[3] }); and the I sent 3 Notify immediately after each other: ip=# notify foo ,'123'; NOTIFY ip=# notify foo ,'124'; NOTIFY ip=# notify foo ,'125' The result I got was : foo!123 Finished123 foo!124 Finished124 foo!125 Finished125 So where is the async -feature? What I expected was foo!123 foo!124 foo!125 Finished123 Finished124 Finished125 Did I understand that wrong ? Regards Rolf Schaufelberger
"sleep" should not be used with AnyEvent (or any other event-programming framework). You should use a timer instead. In order to use AnyEvent::Pg you must understand how AnyEvent works first.