The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.


Net::Async::ArtNet - use ArtNet with IO::Async


   use IO::Async::Loop;
   use Net::Async::ArtNet;

   my $loop = IO::Async::Loop->new;

   $loop->add( Net::Async::ArtNet->new(
      on_dmx => sub {
         my $self = shift;
         my ( $seq, $phy, $universe, $data ) = @_;

         return unless $phy == 0 and $universe == 0;

         my $ch10 = $data->[10 - 1];  # DMX channels are 1-indexed
         print "Channel 10 now set to: $ch10\n";
   ) );



This object class allows you to use the Art-Net protocol with IO::Async. It receives Art-Net frames containing DMX data.


on_dmx $seq, $phy, $uni, $data

A new set of DMX control values has been received. $seq contains the sequence number from the packet, $phy and $uni the physical and universe numbers, and $data will be an ARRAY reference containing up to 512 DMX control values.


The following named parameters may be passed to new or configure. Additionally, CODE references to set callbacks for events may be passed.

family => INT or STRING
host => INT or STRING
service => INT or STRING

Optional. getaddrinfo parameters to create socket listen for Art-Net packets on.

port => INT or STRING

Synonym for service parameter.



Paul Evans <>