Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.6 / 3....
  • Linux Kernel 3.0.82 LTS...
  • KDE Software Compilatio...
  • PulseAudio 4.0
  • Wireshark 1.10.0
  • NetworkManager 0.9.8.2
  • LibreOffice 3.6.6 / 4.0...
  • SystemRescueCd 3.7.0
  • Linux Kernel 3.10 RC6
  • Ubuntu Tweak 0.8.5
  • Home > Linux > Programming > Perl Modules

    AnyEvent::MP 1.28

    Download button

    No screenshots available
    Downloads: 293  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Marc Lehmann | More programs
    Perl Artistic License / FREE
    April 29th, 2010, 17:33 GMT
    ROOT / Programming / Perl Modules

     Read user reviews (0)  Refer to a friend  Subscribe

    AnyEvent::MP description

    Erlang-style multi-processing/message-passing framework

    AnyEvent::MP is a Perl module (-family) that implements a simple message passing framework.

    Despite its simplicity, you can securely message other processes running on the same or other hosts, and you can supervise entities remotely.

    For an introduction to this module family, see the AnyEvent::MP::Intro manual page and the examples under eg/.

    SYNOPSIS

     use AnyEvent::MP;

     $NODE # contains this node's node ID
     NODE # returns this node's node ID

     $SELF # receiving/own port id in rcv callbacks

     # initialise the node so it can send/receive messages
     configure;

     # ports are message destinations

     # sending messages
     snd $port, type => data...;
     snd $port, @msg;
     snd @msg_with_first_element_being_a_port;

     # creating/using ports, the simple way
     my $simple_port = port { my @msg = @_ };

     # creating/using ports, tagged message matching
     my $port = port;
     rcv $port, ping => sub { snd $_[0], "pong" };
     rcv $port, pong => sub { warn "pong received\n" };

     # create a port on another node
     my $port = spawn $node, $initfunc, @initdata;

     # destroy a prot again
     kil $port; # "normal" kill
     kil $port, my_error => "everything is broken"; # error kill

     # monitoring
     mon $localport, $cb->(@msg) # callback is invoked on death
     mon $localport, $otherport # kill otherport on abnormal death
     mon $localport, $otherport, @msg # send message on death

     # temporarily execute code in port context
     peval $port, sub { die "kill the port!" };

     # execute callbacks in $SELF port context
     my $timer = AE::timer 1, 0, psub {
     die "kill the port, delayed";
     };



    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    passing framework | Perl module | Perl | passing | framework

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM