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
2
votes
1 answer

AnyEvent::Socket and abstract UNIX socket

With Socket i can use: socket(my $socket, AF_UNIX, SOCK_STREAM, 0) or die "socket: $!"; my $sock_addr = sockaddr_un(chr(0).'/abstract/socket'); connect($socket, $sock_addr) or die "connect: $!"; all ok. i connect and can transmit/receive; With…
askovpen
  • 2,438
  • 22
  • 37
2
votes
2 answers

What is the smart way for start parallel tasks in forked proccess via perl, linux and anyevent?

I have an issue with AnyEvent::Utils::fork_call. I m using fork_call, then doing some work, and after that i should end my fork_call, and start new parallel task. I tried that: fork_call { # very important work # start new parallel task …
rasmikun
  • 45
  • 3
2
votes
1 answer

How can I get the user jabber Id in a chat room using AnyEvent::XMPP?

There is a way to get the user's nick(roomName@domain.com/nick) in the chatroom according to the document, but how can I get the user's real jid(name@domain.com/resource_name)? is it possible according to XMPP protocol?
woosley. xu
  • 182
  • 1
  • 12
1
vote
2 answers

How to make anyevent "sequential"?

I would like to try mix of AnyEvent and Coro. Is there a way to make the three lines between BEGIN and END more elegant/condensed? use AnyEvent::HTTP; use Coro; async { _ # BEGIN my $READY = AnyEvent->condvar; my $guard = http_request( GET…
AnFi
  • 10,493
  • 3
  • 23
  • 47
1
vote
1 answer

Perl's AnyEvent::IRC::Client library does not close after sending messages

I'm exploring the AnyEvent::IRC::Client library to send a list of messages to an IRC channel. I follow the sample code from its metacpan site (ref: https://metacpan.org/pod/AnyEvent::IRC::Client), except that I need to send a list of messages…
santa100
  • 255
  • 1
  • 5
1
vote
2 answers

AnyEvent tcp server-client example for localhost hangs when not using TLS

While debugging a failed test for AnyEvent on Windows, I created the following script based on test 80_ssltest.t: use feature qw(say); use strict; use warnings; use AnyEvent::Socket; use AnyEvent::Handle; use AnyEvent::TLS; my $ctx =…
Håkon Hægland
  • 39,012
  • 21
  • 81
  • 174
1
vote
0 answers

AnyEvent::WebSocket::Client finish callback not called

I am having issue using AnyEvent::WebSocket::Client. The send/receive system works well, but I want to use the on finish callback to handle connection closure but it is never called. my $client =…
robinvrd
  • 1,760
  • 12
  • 28
1
vote
1 answer

Perl: multithreaded server with Coro and AnyEvent

I am a newbie in Perl, so in educational purposes I am developing multithreaded server using AnyEvent and Coro. The client sends to server list of directory paths and server responses with listing of these directories. I am using tcp_server and…
NRogo
  • 13
  • 2
1
vote
0 answers

How to make external command's output autoflush with AnyEvent::Subprocess?

I am trying to monitor the output of an external command with AnyEvent::Subprocess: use feature qw(say); use strict; use warnings; use AnyEvent::Subprocess; my $job = AnyEvent::Subprocess->new( delegates => [ 'StandardHandles',…
Håkon Hægland
  • 39,012
  • 21
  • 81
  • 174
1
vote
0 answers

Perl Error when requesting proxy to https site. AnyEvent status 596

when requesting through a proxy that supports https to https site. The error 'Reason' => 'ssl23_get_server_hello comes: unknown protocol', 'Status' => 596, I use the AnyEvent library, I suspect that the problem with the connect request, but I cannot…
1
vote
0 answers

Parallel processing using AnyEvent (Any) module with custom function

I am trying to use the AnyEvent module to fetch some information of several web pages in parallel. In Example: Fetching several web pages in parallel using AnyEvent #!/usr/bin/perl use strict; use warnings; use Data::Dumper; use AnyEvent; use…
AbhiNickz
  • 1,035
  • 2
  • 14
  • 32
1
vote
0 answers

Can't install AnyEvent::DBI with Cpan on macOS High Sierra

there was a problem installing the AnyEvent::DBI for perl v5.18.2 on macOS High Sierra 10.13.3 As I understood, the AnyEvent::Fork dependency module is not installed, here's the information from CPAN cpan[1]> install AnyEvent::Fork Reading…
Dmitriy
  • 463
  • 1
  • 5
  • 12
1
vote
1 answer

What is best way in Perl to set a timer to stop long-running process?

I've got an application that invokes a potentially long-running process. I want my program, the caller of this process, to cancel it at any given point and move on to the next entry when a time limit is exceeded. Using Perl's AnyEvent module, I…
scott8035
  • 424
  • 1
  • 6
  • 15
1
vote
1 answer

Does AnyEvent work with perl 5.26?

I've met the following error:: Can't use an undefined value as a subroutine reference at /home/basiliscos/perl5/perlbrew/perls/perl-5.26.0/lib/site_perl/5.26.0/x86_64-linux/AnyEvent/Loop.pm line 248 when I run my program under perl 5.26.0,…
Ivan Baidakou
  • 713
  • 9
  • 14
1
vote
1 answer

How to define an environment variable before loading modules?

I use the AnyEvent::DNS module. I want to disable IPv6, so that the resolver only makes a request for A record. AnyEvent::DNS, uses the environment variable $ENV{PERL_ANYEVENT_PROTOCOLS} But setting the variable does not work; the resolver still…
Dmitriy
  • 463
  • 1
  • 5
  • 12