Questions tagged [anyevent]

AnyEvent is a Perl framework for event-based programming

AnyEvent(similar to POE and Twisted) is a framework for event-based programming. It comes with a number of different implementations while maintaining the same API(unless otherwise mentioned in the documentation). The current implementations are POE,Perl(pure Perl),IOAsync,EV,Event,EventLib,Cocoa,FLTK,Glib,Irssi,Qt,Tk.

It can be used for building high-performance applications that scale well. At the same time, synchronization primitives are available(condition variables), polling(via poll or epoll), running periodic tasks, inotify support(via AnyEvent::Filesys::Notify), database support(via AnyEvent::DBI), forking(via AnyEvent::Fork) and it comes with a built-in non-blocking HTTP client(AnyEvent::HTTP). There are many modules that extend AnyEvent's functionality which can be found on CPAN.

85 questions
1
vote
0 answers

Restart a script using AnyEvent::Twitter::Stream api

I did a tweet crawler using the cpan library AnyEvent::Twitter::Stream with OAuth authentication, but I'm having some problems. Sometimes, Twitter stops to send tweets through the streaming api. Then, I send my program to sleep for a while and then…
Thiago
  • 694
  • 3
  • 12
  • 26
0
votes
1 answer

How to configure AnyEvent::DNS resolver by default?

How to configure AnyEvent::DNS resolver by default, I want to change max_outstanding, reuse, timeout. There is an environment variable $ENV{PERL_ANYEVENT_MAX_OUTSTANDING_DNS}, but how to change reuse and timeout ?
Dmitriy
  • 463
  • 1
  • 5
  • 12
0
votes
2 answers

Examples from Net::RabbitMQ not working

I'm trying to learn RabbitMQ for a project I'm working on. My research showed two libraries to use, Net::RabbitMQ and AnyEvent::RabbitMQ. AnyEvent::RabbitMQ seems overly baroque for my needs but Net::RabbitMQ does not appear to work as the examples…
SparkeyG
  • 532
  • 7
  • 22
0
votes
2 answers

How do you implement non-blocking responses in a perl plack app?

I'm trying to write a a perl-based webserver using Twiggy::Server (which means a plack app). I want to respond to a request (coming from an ajax call on a webpage) for some data by running some possibly time-consuming subroutine which generates the…
sbs
  • 1,139
  • 3
  • 13
  • 19
0
votes
1 answer

Anyevent::RabbitMQ Perl QoS prefetch_count not working

I've been trying to use RabbitMQ perl library Net::RabbitFoot which uses AnyEvent::RabbitMQ underneath. According to RabbitMQ Tutorial, setting prefetch_count to 1 should ensure fair dispatch, as in should not dispatch a message to a worker that is…
alpha_cod
  • 1,933
  • 5
  • 25
  • 43
0
votes
1 answer

Don't understand how to use WWW::Mechanize with LWP::Protocol::AnyEvent::http

So I've been having a difficult time with my foray into event driven programming. Most of it due to still thinking sequentially but I'm having a hard time understanding how anyone synchronizes their code when using LWP::Protocol::AnyEvent::http and…
mikew
  • 912
  • 2
  • 11
  • 22
0
votes
2 answers

How to check if a child process is alive when using a child watcher in Perl

I am trying to implement some code using AnyEvent and EV. I would like to install a child watcher ( Mockup of what I want done below) use Modern::Perl; use AnyEvent; use EV; my $SIG{QUIT} = \&kill_child; my $exit_status = undef; my $pid = fork or…
Smartelf
  • 849
  • 1
  • 10
  • 26
0
votes
1 answer

Has AnyEvent::DNS max request limit?

I want to use AnyEvent::DNS to resolve my domain on some DNS servers. The server list are got from two place, each about 60+ servers. When I run resolve for only one server list,no problem. But if I run resolve for all list, I got an error: "unable…
chenryn
  • 121
  • 5
0
votes
1 answer

perl Callbacks in async code

I'm trying to make a Queue Manager that get jobs when files are created in a specific folder. I've created my code using AnyEvent so it's async. My problem is, i'm trying to deliver a return value from the subroutines add_route, and del_route, using…
Adamba
  • 1
-1
votes
2 answers

Perl AnyEvent concurrency internals

I have a server, which creates a "AnyEvent timer" watcher object on every client connection (adds it to an AnyEvent loop). use AnyEvent; ... my $db_handle = myschema->connect(); my $w; $w = AnyEvent->timer ( interval => $interval, …
1 2 3 4 5
6