Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^3: PSGI, Plack, Twiggy, AnyEvent and SockJS... I need help

by Anonymous Monk
on Apr 09, 2014 at 15:23 UTC ( #1081672=note: print w/replies, xml ) Need Help??


in reply to Re^2: PSGI, Plack, Twiggy, AnyEvent and SockJS... I need help
in thread PSGI, Plack, Twiggy, AnyEvent and SockJS... I need help

On another glance
my $w; $w = AnyEvent->timer(
is correct, but
$w_cond->send();
within your timer cb is not what you want. From AnyEvent:
$w->recv; # enters "main loop" till $condvar gets ->send
You want to ->recv when you are done with things. Adding another timeout timer for example would do the trick allowing your timer to run couple of times and eventually terminating your timer and the main loop after 30 seconds:
my $w; $w = AnyEvent->timer( after => 0, interval => 5, cb => sub { $session->write('5 seconds have passed'); } ); my $timeout_timer; $timeout_timer = AnyEvent->timer( after => 0, interval => 30, cb => sub { undef $w; undef $timeout_timer; $session->write('Timeout after 30 seconds'); $w_cond->send(); } );

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1081672]
help
Chatterbox?
[stevieb]: I don't know what you mean. I write the code in C/C++ that accesses the ICs per the datasheet, wrap it for Perl, then use them. My code ensures that the functions/methods from Perl do the right thing for the chips/sensors etc
[stevieb]: At least that's what I'm working on right now. I've also been updating my automated test software Test::BrewBuild so it handles this work properly. It's not really easy meshing high level languages with low-level hardware :)
[stevieb]: this link is probably better for an overview of my test software
[stevieb]: the top-level Raspberry Pi distribution, that sucks in all sub modules. All of this software have imminent updated releases coming

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (3)
As of 2017-06-25 23:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many monitors do you use while coding?















    Results (572 votes). Check out past polls.