SlideShare a Scribd company logo
POE
Stefano Rodighiero
  OpenExp 2006
Perl
Object
Environment
       POE - A Perl Object Environment
?
    POE - A Perl Object Environment
Framework

     POE - A Perl Object Environment
Event
driven
    POE - A Perl Object Environment
Multitasking
Cooperativo
       POE - A Perl Object Environment
Single
thread
   POE - A Perl Object Environment
Networking

      POE - A Perl Object Environment
System
administration
        POE - A Perl Object Environment
GUI
  POE - A Perl Object Environment
POE - A Perl Object Environment
Component


  Wheel

            “Architettura”
 Session


 Kernel




                POE - A Perl Object Environment
Component


  Wheel
            Dispatch di eventi
 Session


 Kernel




               POE - A Perl Object Environment
Component


  Wheel
            Risponde agli eventi
 Session


 Kernel




                POE - A Perl Object Environment
Component

            “Plugin” per sessioni,
             incapsula insiemi di
  Wheel
               gestori di eventi
 Session    POE::Wheel::FollowTail
              POE::Wheel::Run
 Kernel




                 POE - A Perl Object Environment
Component


  Wheel            POE::Component::IRC
               POE::Component::Server::TCP
            POE::Component::Server::SimpleHTTP
                        …CPAN…
 Session


 Kernel




                      POE - A Perl Object Environment
POE - A Perl Object Environment
Un programma tipico

• Istanzia una o più sessioni
 • Esplicitamente, eventualmente usando
    delle Wheel
 • Implicitamente, con Componenti già
    pronti
• POE::Kernel->run()

                           POE - A Perl Object Environment
sub POE::Kernel::TRACE_EVENTS() { 1 }




                       POE - A Perl Object Environment
use POE;

     POE - A Perl Object Environment
for ( 1 .. 3 ) {
  POE::Session -> create(
    inline_states => {
      _start => sub { print quot;Start!nquot; },
      _stop => sub { print quot;Stop!nquot; }
    } );
}




                         POE - A Perl Object Environment
POE::Kernel->run();



            POE - A Perl Object Environment
_start

Session



             Kernel




          POE - A Perl Object Environment
_start

    Session

_start =>
  sub {
    print quot;Start!nquot;
                          Kernel
  }




                       POE - A Perl Object Environment
Passaggio di messaggi

            Accoda un evento, da inoltrare
  post()       alla session specificata

            Accoda un evento, da inoltrare
  yield()        alla session stessa

                Invoca - in maniera
            sincrona - un evento per una
  call()
                  sessione specificata


                         POE - A Perl Object Environment
Passaggio di messaggi

post()/yield()




                 POE - A Perl Object Environment
Passaggio di messaggi



call()




             POE - A Perl Object Environment
Comunicazione
 tra sessioni

        POE - A Perl Object Environment
# Sessione Babbo Natale
POE::Session->create(
   inline_states => {
     _start => sub {
       print quot;Oh oh oh!nquot;;
       $poe_kernel->alias_set( quot;Santaquot; );
     },
     lettera => sub {
       print quot;Lettera da quot;
           . $poe_kernel->alias_list( $_[SENDER] );
     }
   }
);


                               POE - A Perl Object Environment
# Sessione Babbo Natale
POE::Session->create(
   inline_states => {
     _start => sub {
       print quot;Oh oh oh!nquot;;
       $poe_kernel->alias_set( quot;Santaquot; );
     },
     lettera => sub {
       print quot;Lettera da quot;
           . $poe_kernel->alias_list( $_[SENDER] );
     }
   }
);


                               POE - A Perl Object Environment
# Sessione Babbo Natale
POE::Session->create(
   inline_states => {
     _start => sub {
       print quot;Oh oh oh!nquot;;
       $poe_kernel->alias_set( quot;Santaquot; );
     },
     lettera => sub {
       print quot;Lettera da quot;
           . $poe_kernel->alias_list( $_[SENDER] );
     }
   }
);


                               POE - A Perl Object Environment
# Sessione Babbo Natale
POE::Session->create(
   inline_states => {
     _start => sub {
       print quot;Oh oh oh!nquot;;
       $poe_kernel->alias_set( quot;Santaquot; );
     },
     lettera => sub {
       print quot;Lettera da quot;
           . $poe_kernel->alias_list( $_[SENDER] );
     }
   }
);


                               POE - A Perl Object Environment
# Sessione bimbo
POE::Session->create(
   inline_states => {
     _start => sub {
       $poe_kernel->alias_set( quot;Paolinoquot; );
       $poe_kernel->post( quot;Santaquot; => 'lettera' );
     },
   }
);




                              POE - A Perl Object Environment
# Sessione bimbo
POE::Session->create(
   inline_states => {
     _start => sub {
       $poe_kernel->alias_set( quot;Paolinoquot; );
       $poe_kernel->post( quot;Santaquot; => 'lettera' );
     },
   }
);




                              POE - A Perl Object Environment
Babbo Natale       _start




                                Kernel
Paolino
                         _start




                          POE - A Perl Object Environment
Babbo Natale




                               Kernel
Paolino



      post( quot;Santaquot;, quot;letteraquot; )


                         POE - A Perl Object Environment
lettera
          Babbo Natale




                               Kernel
Paolino




                         POE - A Perl Object Environment
lettera
           Babbo Natale
lettera




                                 Kernel
 Paolino



          post( quot;Santaquot;, quot;letteraquot; )


                           POE - A Perl Object Environment
POE - A Perl Object Environment
Wheel
   POE - A Perl Object Environment
Insiemi di
gestori di
  eventi
       POE - A Perl Object Environment
POE::
 Wheel::
FollowTail
      POE - A Perl Object Environment
use POE qw(
	

Wheel::FollowTail
);


              POE - A Perl Object Environment
$|++

   POE - A Perl Object Environment
POE::Session-create(
  inline_states = {...



              POE - A Perl Object Environment
_start = sub {
  my $heap = $_[ HEAP ];
  my $watcher = POE::Wheel::FollowTail-new(
     Filename     = 'logfile.log',
     PollInterval = 1,
     InputEvent   = 'input_state'
  );
  $heap-{ watcher } = $watcher;
} , ...



                           POE - A Perl Object Environment
_start = sub {
  my $heap = $_[ HEAP ];
  my $watcher = POE::Wheel::FollowTail-new(
     Filename     = 'logfile.log',
     PollInterval = 1,
     InputEvent   = 'input_state'
  );
  $heap-{ watcher } = $watcher;
} , ...



                           POE - A Perl Object Environment
_start = sub {
  my $heap = $_[ HEAP ];
  my $watcher = POE::Wheel::FollowTail-new(
     Filename     = 'logfile.log',
     PollInterval = 1,
     InputEvent   = 'input_state'
  );
  $heap-{ watcher } = $watcher;
} , ...



                           POE - A Perl Object Environment
_start = sub {
  my $heap = $_[ HEAP ];
  my $watcher = POE::Wheel::FollowTail-new(
     Filename     = 'logfile.log',
     PollInterval = 1,
     InputEvent   = 'input_state'
  );
  $heap-{ watcher } = $watcher;
} , ...



                           POE - A Perl Object Environment
_start = sub {
  my $heap = $_[ HEAP ];
  my $watcher = POE::Wheel::FollowTail-new(
     Filename     = 'logfile.log',
     PollInterval = 1,
     InputEvent   = 'input_state'
  );
  $heap-{ watcher } = $watcher;
} , ...



                           POE - A Perl Object Environment
input_state = sub {
  my $input = $_[ ARG0 ];
  print $input;
}



                POE - A Perl Object Environment
Session
__________
__________
__________
__________
__________
__________
             Wheel




                POE - A Perl Object Environment
Session
__________
__________
__________
                             input_event
__________
__________
__________
             Wheel




                POE - A Perl Object Environment
POE - A Perl Object Environment
POE
+ Test
+ IRC
    POE - A Perl Object Environment
Testing?
     POE - A Perl Object Environment
Failed 3/10
           tests


                 ?
Test                             IRC




                     POE - A Perl Object Environment
09:41  Quinn larsen: Avast!
               Whoreson swab!
               You failed 3/10 tests!




                       POE - A Perl Object Environment
?
Test                   IRC




           POE - A Perl Object Environment
Session

               POE::
              Wheel::
__________   FollowTail
__________
__________
__________
__________
__________




               POE::
             Component::
                IRC




                           POE - A Perl Object Environment
POE::
Component::
    IRC
       POE - A Perl Object Environment
use POE qw/ Wheel::FollowTail
             Component::IRC
          /;




                  POE - A Perl Object Environment
use Acme::Scurvy::Whoreson::BilgeRat;




                       POE - A Perl Object Environment
my $conf = {
    nick     = 'Quinn',
    ircname = 'HAR!',
    server = 'irc.freenode.net',
    port     = 6667
};
my $channel = '#scummbar';



                     POE - A Perl Object Environment
my $irc = POE::Component::IRC-spawn( %$conf )
  or die quot;HAR!!! $!quot;;




                              POE - A Perl Object Environment
POE::Session-create(
    package_states = [
        'main' = [ qw(
            _default
            _start
            irc_001
            irc_public
            tell_results
        ) ],
    ],
    heap = { irc = $irc }
);
                  POE - A Perl Object Environment
POE::Session-create(
    package_states = [
        'main' = [ qw(
            _default
            _start
            irc_001
            irc_public
            tell_results
        ) ],
    ],
    heap = { irc = $irc }
);
                  POE - A Perl Object Environment
POE::Session-create(
    package_states = [
        'main' = [ qw(
            _default
            _start
            irc_001
            irc_public
            tell_results
        ) ],
    ],
    heap = { irc = $irc }
);
                  POE - A Perl Object Environment
sub _start {
  my ( $kernel, $heap ) = @_[ KERNEL, HEAP ];

    my $watcher = POE::Wheel::FollowTail-new(
      Filename     = 'tests.log' ,
      PollInterval = 1 ,
      InputEvent   = 'tell_results'
    );

    $heap-{ watcher } = $watcher;

    my $irc_sess = $heap-{irc}-session_id();
    $kernel-post( $irc_sess = register = 'all' );
    $kernel-post( $irc_sess = connect = {} );
    undef;
}

                                     POE - A Perl Object Environment
sub _start {
  my ( $kernel, $heap ) = @_[ KERNEL, HEAP ];

    my $watcher = POE::Wheel::FollowTail-new(
      Filename     = 'tests.log' ,
      PollInterval = 1 ,
      InputEvent   = 'tell_results'
    );

    $heap-{ watcher } = $watcher;

    my $irc_sess = $heap-{irc}-session_id();
    $kernel-post( $irc_sess = register = 'all' );
    $kernel-post( $irc_sess = connect = {} );
    undef;
}

                                     POE - A Perl Object Environment
sub _start {
  my ( $kernel, $heap ) = @_[ KERNEL, HEAP ];

    my $watcher = POE::Wheel::FollowTail-new(
      Filename     = 'tests.log' ,
      PollInterval = 1 ,
      InputEvent   = 'tell_results'
    );

    $heap-{ watcher } = $watcher;

    my $irc_sess = $heap-{irc}-session_id();
    $kernel-post( $irc_sess = register = 'all' );
    $kernel-post( $irc_sess = connect = {} );
    undef;
}

                                     POE - A Perl Object Environment
sub irc_001 {
    my ( $kernel, $sender ) =
      @_[ KERNEL, SENDER ];

    $kernel-post(
      $sender = join = $channel );
    undef;
}



                       POE - A Perl Object Environment
sub tell_results
{
  my $kernel         =   $_[KERNEL];
  my $heap           =   $_[HEAP];
  my $line           =   $_[ARG0];
  my $irc_session    =   $heap-{irc};

    my ($failed, $total) = split qr|/|, $line;

    if ($failed) {
      my $insult = Acme::Scurvy::Whoreson::BilgeRat-new(
         language = 'pirate'
      );

        $kernel-post(
          $irc_session = privmsg =
            $channel = quot;$insult! You failed $failed tests!quot; );
        }
    }
}

                                          POE - A Perl Object Environment
sub tell_results
{
  my $kernel         =   $_[KERNEL];
  my $heap           =   $_[HEAP];
  my $line           =   $_[ARG0];
  my $irc_session    =   $heap-{irc};

    my ($failed, $total) = split qr|/|, $line;

    if ($failed) {
      my $insult = Acme::Scurvy::Whoreson::BilgeRat-new(
         language = 'pirate'
      );

        $kernel-post(
          $irc_session = privmsg =
            $channel = quot;$insult! You failed $failed tests!quot; );
        }
    }
}

                                          POE - A Perl Object Environment
sub tell_results
{
  my $kernel         =   $_[KERNEL];
  my $heap           =   $_[HEAP];
  my $line           =   $_[ARG0];
  my $irc_session    =   $heap-{irc};

    my ($failed, $total) = split qr|/|, $line;

    if ($failed) {
      my $insult = Acme::Scurvy::Whoreson::BilgeRat-new(
         language = 'pirate'
      );

        $kernel-post(
          $irc_session = privmsg =
            $channel = quot;$insult! You failed $failed tests!quot; );
        }
    }
}

                                          POE - A Perl Object Environment
POE - A Perl Object Environment
• irc.freenode.net,#poe
• http://poe.perl.org
• “Advanced Perl
  Programming” (O’Reilly) - Cap.7
• http://del.icio.us/slr/poe               ☺


                        POE - A Perl Object Environment
• http://www.perl.it
• irc.freenode.net,#perl.it
• mongers@perl.it


                   POE - A Perl Object Environment
Grazie!
Stefano Rodighiero
  larsen@perl.it

More Related Content

What's hot

Metadata-driven Testing
Metadata-driven TestingMetadata-driven Testing
Metadata-driven Testing
Workhorse Computing
 
The $path to knowledge: What little it take to unit-test Perl.
The $path to knowledge: What little it take to unit-test Perl.The $path to knowledge: What little it take to unit-test Perl.
The $path to knowledge: What little it take to unit-test Perl.
Workhorse Computing
 
Object Trampoline: Why having not the object you want is what you need.
Object Trampoline: Why having not the object you want is what you need.Object Trampoline: Why having not the object you want is what you need.
Object Trampoline: Why having not the object you want is what you need.
Workhorse Computing
 
Does your configuration code smell?
Does your configuration code smell?Does your configuration code smell?
Does your configuration code smell?
Tushar Sharma
 
YAPC::Brasil 2009, POE
YAPC::Brasil 2009, POEYAPC::Brasil 2009, POE
YAPC::Brasil 2009, POE
Thiago Rondon
 
Ethiopian multiplication in Perl6
Ethiopian multiplication in Perl6Ethiopian multiplication in Perl6
Ethiopian multiplication in Perl6
Workhorse Computing
 
Puppet Camp Paris 2015: Power of Puppet 4 (Beginner)
Puppet Camp Paris 2015: Power of Puppet 4 (Beginner) Puppet Camp Paris 2015: Power of Puppet 4 (Beginner)
Puppet Camp Paris 2015: Power of Puppet 4 (Beginner)
Puppet
 
Keeping objects healthy with Object::Exercise.
Keeping objects healthy with Object::Exercise.Keeping objects healthy with Object::Exercise.
Keeping objects healthy with Object::Exercise.
Workhorse Computing
 
Get your teeth into Plack
Get your teeth into PlackGet your teeth into Plack
Get your teeth into Plack
Workhorse Computing
 
BSDM with BASH: Command Interpolation
BSDM with BASH: Command InterpolationBSDM with BASH: Command Interpolation
BSDM with BASH: Command Interpolation
Workhorse Computing
 
Troubleshooting Puppet
Troubleshooting PuppetTroubleshooting Puppet
Troubleshooting Puppet
Thomas Howard Uphill
 
A Functional Guide to Cat Herding with PHP Generators
A Functional Guide to Cat Herding with PHP GeneratorsA Functional Guide to Cat Herding with PHP Generators
A Functional Guide to Cat Herding with PHP Generators
Mark Baker
 
Memory Manglement in Raku
Memory Manglement in RakuMemory Manglement in Raku
Memory Manglement in Raku
Workhorse Computing
 
Perl6 Regexen: Reduce the line noise in your code.
Perl6 Regexen: Reduce the line noise in your code.Perl6 Regexen: Reduce the line noise in your code.
Perl6 Regexen: Reduce the line noise in your code.
Workhorse Computing
 
Tobias Nyholm "Deep dive into Symfony 4 internals"
Tobias Nyholm "Deep dive into Symfony 4 internals"Tobias Nyholm "Deep dive into Symfony 4 internals"
Tobias Nyholm "Deep dive into Symfony 4 internals"
Fwdays
 
DevOps with Fabric
DevOps with FabricDevOps with Fabric
DevOps with Fabric
Simone Federici
 
Short Introduction To "perl -d"
Short Introduction To "perl -d"Short Introduction To "perl -d"
Short Introduction To "perl -d"
Workhorse Computing
 
Building and Distributing PostgreSQL Extensions Without Learning C
Building and Distributing PostgreSQL Extensions Without Learning CBuilding and Distributing PostgreSQL Extensions Without Learning C
Building and Distributing PostgreSQL Extensions Without Learning C
David Wheeler
 
Smoking docker
Smoking dockerSmoking docker
Smoking docker
Workhorse Computing
 
The Joy of Smartmatch
The Joy of SmartmatchThe Joy of Smartmatch
The Joy of Smartmatch
Andrew Shitov
 

What's hot (20)

Metadata-driven Testing
Metadata-driven TestingMetadata-driven Testing
Metadata-driven Testing
 
The $path to knowledge: What little it take to unit-test Perl.
The $path to knowledge: What little it take to unit-test Perl.The $path to knowledge: What little it take to unit-test Perl.
The $path to knowledge: What little it take to unit-test Perl.
 
Object Trampoline: Why having not the object you want is what you need.
Object Trampoline: Why having not the object you want is what you need.Object Trampoline: Why having not the object you want is what you need.
Object Trampoline: Why having not the object you want is what you need.
 
Does your configuration code smell?
Does your configuration code smell?Does your configuration code smell?
Does your configuration code smell?
 
YAPC::Brasil 2009, POE
YAPC::Brasil 2009, POEYAPC::Brasil 2009, POE
YAPC::Brasil 2009, POE
 
Ethiopian multiplication in Perl6
Ethiopian multiplication in Perl6Ethiopian multiplication in Perl6
Ethiopian multiplication in Perl6
 
Puppet Camp Paris 2015: Power of Puppet 4 (Beginner)
Puppet Camp Paris 2015: Power of Puppet 4 (Beginner) Puppet Camp Paris 2015: Power of Puppet 4 (Beginner)
Puppet Camp Paris 2015: Power of Puppet 4 (Beginner)
 
Keeping objects healthy with Object::Exercise.
Keeping objects healthy with Object::Exercise.Keeping objects healthy with Object::Exercise.
Keeping objects healthy with Object::Exercise.
 
Get your teeth into Plack
Get your teeth into PlackGet your teeth into Plack
Get your teeth into Plack
 
BSDM with BASH: Command Interpolation
BSDM with BASH: Command InterpolationBSDM with BASH: Command Interpolation
BSDM with BASH: Command Interpolation
 
Troubleshooting Puppet
Troubleshooting PuppetTroubleshooting Puppet
Troubleshooting Puppet
 
A Functional Guide to Cat Herding with PHP Generators
A Functional Guide to Cat Herding with PHP GeneratorsA Functional Guide to Cat Herding with PHP Generators
A Functional Guide to Cat Herding with PHP Generators
 
Memory Manglement in Raku
Memory Manglement in RakuMemory Manglement in Raku
Memory Manglement in Raku
 
Perl6 Regexen: Reduce the line noise in your code.
Perl6 Regexen: Reduce the line noise in your code.Perl6 Regexen: Reduce the line noise in your code.
Perl6 Regexen: Reduce the line noise in your code.
 
Tobias Nyholm "Deep dive into Symfony 4 internals"
Tobias Nyholm "Deep dive into Symfony 4 internals"Tobias Nyholm "Deep dive into Symfony 4 internals"
Tobias Nyholm "Deep dive into Symfony 4 internals"
 
DevOps with Fabric
DevOps with FabricDevOps with Fabric
DevOps with Fabric
 
Short Introduction To "perl -d"
Short Introduction To "perl -d"Short Introduction To "perl -d"
Short Introduction To "perl -d"
 
Building and Distributing PostgreSQL Extensions Without Learning C
Building and Distributing PostgreSQL Extensions Without Learning CBuilding and Distributing PostgreSQL Extensions Without Learning C
Building and Distributing PostgreSQL Extensions Without Learning C
 
Smoking docker
Smoking dockerSmoking docker
Smoking docker
 
The Joy of Smartmatch
The Joy of SmartmatchThe Joy of Smartmatch
The Joy of Smartmatch
 

Similar to POE

The symfony platform: Create your very own framework (PHP Quebec 2008)
The symfony platform: Create your very own framework (PHP Quebec 2008)The symfony platform: Create your very own framework (PHP Quebec 2008)
The symfony platform: Create your very own framework (PHP Quebec 2008)
Fabien Potencier
 
Kansai.pm 10周年記念 Plack/PSGI 入門
Kansai.pm 10周年記念 Plack/PSGI 入門Kansai.pm 10周年記念 Plack/PSGI 入門
Kansai.pm 10周年記念 Plack/PSGI 入門
lestrrat
 
GettingStartedWithPHP
GettingStartedWithPHPGettingStartedWithPHP
GettingStartedWithPHP
Nat Weerawan
 
symfony on action - WebTech 207
symfony on action - WebTech 207symfony on action - WebTech 207
symfony on action - WebTech 207
patter
 
Tutorial Puppet
Tutorial PuppetTutorial Puppet
Tutorial Puppet
Daniel Sobral
 
Symfony2, creare bundle e valore per il cliente
Symfony2, creare bundle e valore per il clienteSymfony2, creare bundle e valore per il cliente
Symfony2, creare bundle e valore per il cliente
Leonardo Proietti
 
effective_r27
effective_r27effective_r27
effective_r27
Hiroshi Ono
 
Puppet @ Seat
Puppet @ SeatPuppet @ Seat
Puppet @ Seat
Alessandro Franceschi
 
Os Treat
Os TreatOs Treat
Os Treat
oscon2007
 
PL/Perl - New Features in PostgreSQL 9.0 201012
PL/Perl - New Features in PostgreSQL 9.0 201012PL/Perl - New Features in PostgreSQL 9.0 201012
PL/Perl - New Features in PostgreSQL 9.0 201012
Tim Bunce
 
PL/Perl - New Features in PostgreSQL 9.0
PL/Perl - New Features in PostgreSQL 9.0PL/Perl - New Features in PostgreSQL 9.0
PL/Perl - New Features in PostgreSQL 9.0
Tim Bunce
 
Puppet for Java developers - JavaZone NO 2012
Puppet for Java developers - JavaZone NO 2012Puppet for Java developers - JavaZone NO 2012
Puppet for Java developers - JavaZone NO 2012
Carlos Sanchez
 
Perforce Object and Record Model
Perforce Object and Record Model  Perforce Object and Record Model
Perforce Object and Record Model
Perforce
 
Puppet and the HashiStack
Puppet and the HashiStackPuppet and the HashiStack
Puppet and the HashiStack
Bram Vogelaar
 
Lean Php Presentation
Lean Php PresentationLean Php Presentation
Lean Php Presentation
Alan Pinstein
 
Symfony2 - WebExpo 2010
Symfony2 - WebExpo 2010Symfony2 - WebExpo 2010
Symfony2 - WebExpo 2010
Fabien Potencier
 
Symfony2 - WebExpo 2010
Symfony2 - WebExpo 2010Symfony2 - WebExpo 2010
Symfony2 - WebExpo 2010
Fabien Potencier
 
Perl 5.10
Perl 5.10Perl 5.10
Perl 5.10
acme
 
Intro to pl/PHP Oscon2007
Intro to pl/PHP Oscon2007Intro to pl/PHP Oscon2007
Intro to pl/PHP Oscon2007
Robert Treat
 
Symfony2 - OSIDays 2010
Symfony2 - OSIDays 2010Symfony2 - OSIDays 2010
Symfony2 - OSIDays 2010
Fabien Potencier
 

Similar to POE (20)

The symfony platform: Create your very own framework (PHP Quebec 2008)
The symfony platform: Create your very own framework (PHP Quebec 2008)The symfony platform: Create your very own framework (PHP Quebec 2008)
The symfony platform: Create your very own framework (PHP Quebec 2008)
 
Kansai.pm 10周年記念 Plack/PSGI 入門
Kansai.pm 10周年記念 Plack/PSGI 入門Kansai.pm 10周年記念 Plack/PSGI 入門
Kansai.pm 10周年記念 Plack/PSGI 入門
 
GettingStartedWithPHP
GettingStartedWithPHPGettingStartedWithPHP
GettingStartedWithPHP
 
symfony on action - WebTech 207
symfony on action - WebTech 207symfony on action - WebTech 207
symfony on action - WebTech 207
 
Tutorial Puppet
Tutorial PuppetTutorial Puppet
Tutorial Puppet
 
Symfony2, creare bundle e valore per il cliente
Symfony2, creare bundle e valore per il clienteSymfony2, creare bundle e valore per il cliente
Symfony2, creare bundle e valore per il cliente
 
effective_r27
effective_r27effective_r27
effective_r27
 
Puppet @ Seat
Puppet @ SeatPuppet @ Seat
Puppet @ Seat
 
Os Treat
Os TreatOs Treat
Os Treat
 
PL/Perl - New Features in PostgreSQL 9.0 201012
PL/Perl - New Features in PostgreSQL 9.0 201012PL/Perl - New Features in PostgreSQL 9.0 201012
PL/Perl - New Features in PostgreSQL 9.0 201012
 
PL/Perl - New Features in PostgreSQL 9.0
PL/Perl - New Features in PostgreSQL 9.0PL/Perl - New Features in PostgreSQL 9.0
PL/Perl - New Features in PostgreSQL 9.0
 
Puppet for Java developers - JavaZone NO 2012
Puppet for Java developers - JavaZone NO 2012Puppet for Java developers - JavaZone NO 2012
Puppet for Java developers - JavaZone NO 2012
 
Perforce Object and Record Model
Perforce Object and Record Model  Perforce Object and Record Model
Perforce Object and Record Model
 
Puppet and the HashiStack
Puppet and the HashiStackPuppet and the HashiStack
Puppet and the HashiStack
 
Lean Php Presentation
Lean Php PresentationLean Php Presentation
Lean Php Presentation
 
Symfony2 - WebExpo 2010
Symfony2 - WebExpo 2010Symfony2 - WebExpo 2010
Symfony2 - WebExpo 2010
 
Symfony2 - WebExpo 2010
Symfony2 - WebExpo 2010Symfony2 - WebExpo 2010
Symfony2 - WebExpo 2010
 
Perl 5.10
Perl 5.10Perl 5.10
Perl 5.10
 
Intro to pl/PHP Oscon2007
Intro to pl/PHP Oscon2007Intro to pl/PHP Oscon2007
Intro to pl/PHP Oscon2007
 
Symfony2 - OSIDays 2010
Symfony2 - OSIDays 2010Symfony2 - OSIDays 2010
Symfony2 - OSIDays 2010
 

More from Stefano Rodighiero

Perl101 - Italian Perl Workshop 2011
Perl101 - Italian Perl Workshop 2011Perl101 - Italian Perl Workshop 2011
Perl101 - Italian Perl Workshop 2011Stefano Rodighiero
 
On the most excellent theory of time travel, poetic revolutions, and dynamic ...
On the most excellent theory of time travel, poetic revolutions, and dynamic ...On the most excellent theory of time travel, poetic revolutions, and dynamic ...
On the most excellent theory of time travel, poetic revolutions, and dynamic ...
Stefano Rodighiero
 
Perl101
Perl101Perl101
Perl Template Toolkit
Perl Template ToolkitPerl Template Toolkit
Perl Template Toolkit
Stefano Rodighiero
 
Test Automatici^2 per applicazioni Web
Test Automatici^2 per applicazioni WebTest Automatici^2 per applicazioni Web
Test Automatici^2 per applicazioni Web
Stefano Rodighiero
 
Hacking Movable Type
Hacking Movable TypeHacking Movable Type
Hacking Movable Type
Stefano Rodighiero
 
Perl, musica automagica
Perl, musica automagicaPerl, musica automagica
Perl, musica automagica
Stefano Rodighiero
 
Scatole Nere
Scatole NereScatole Nere
Scatole Nere
Stefano Rodighiero
 

More from Stefano Rodighiero (8)

Perl101 - Italian Perl Workshop 2011
Perl101 - Italian Perl Workshop 2011Perl101 - Italian Perl Workshop 2011
Perl101 - Italian Perl Workshop 2011
 
On the most excellent theory of time travel, poetic revolutions, and dynamic ...
On the most excellent theory of time travel, poetic revolutions, and dynamic ...On the most excellent theory of time travel, poetic revolutions, and dynamic ...
On the most excellent theory of time travel, poetic revolutions, and dynamic ...
 
Perl101
Perl101Perl101
Perl101
 
Perl Template Toolkit
Perl Template ToolkitPerl Template Toolkit
Perl Template Toolkit
 
Test Automatici^2 per applicazioni Web
Test Automatici^2 per applicazioni WebTest Automatici^2 per applicazioni Web
Test Automatici^2 per applicazioni Web
 
Hacking Movable Type
Hacking Movable TypeHacking Movable Type
Hacking Movable Type
 
Perl, musica automagica
Perl, musica automagicaPerl, musica automagica
Perl, musica automagica
 
Scatole Nere
Scatole NereScatole Nere
Scatole Nere
 

Recently uploaded

Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
Jason Packer
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
Zilliz
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
shyamraj55
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
Alpen-Adria-Universität
 
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxOcean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
SitimaJohn
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
akankshawande
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
Zilliz
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
Matthew Sinclair
 
Infrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI modelsInfrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI models
Zilliz
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
Pixlogix Infotech
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
panagenda
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
Edge AI and Vision Alliance
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Malak Abu Hammad
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
Zilliz
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
Zilliz
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems S.M.S.A.
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
 
UI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentationUI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentation
Wouter Lemaire
 

Recently uploaded (20)

Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
 
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxOcean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
 
Infrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI modelsInfrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI models
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
 
UI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentationUI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentation
 

POE

  • 2. Perl Object Environment POE - A Perl Object Environment
  • 3. ? POE - A Perl Object Environment
  • 4. Framework POE - A Perl Object Environment
  • 5. Event driven POE - A Perl Object Environment
  • 6. Multitasking Cooperativo POE - A Perl Object Environment
  • 7. Single thread POE - A Perl Object Environment
  • 8. Networking POE - A Perl Object Environment
  • 9. System administration POE - A Perl Object Environment
  • 10. GUI POE - A Perl Object Environment
  • 11. POE - A Perl Object Environment
  • 12. Component Wheel “Architettura” Session Kernel POE - A Perl Object Environment
  • 13. Component Wheel Dispatch di eventi Session Kernel POE - A Perl Object Environment
  • 14. Component Wheel Risponde agli eventi Session Kernel POE - A Perl Object Environment
  • 15. Component “Plugin” per sessioni, incapsula insiemi di Wheel gestori di eventi Session POE::Wheel::FollowTail POE::Wheel::Run Kernel POE - A Perl Object Environment
  • 16. Component Wheel POE::Component::IRC POE::Component::Server::TCP POE::Component::Server::SimpleHTTP …CPAN… Session Kernel POE - A Perl Object Environment
  • 17. POE - A Perl Object Environment
  • 18. Un programma tipico • Istanzia una o più sessioni • Esplicitamente, eventualmente usando delle Wheel • Implicitamente, con Componenti già pronti • POE::Kernel->run() POE - A Perl Object Environment
  • 19. sub POE::Kernel::TRACE_EVENTS() { 1 } POE - A Perl Object Environment
  • 20. use POE; POE - A Perl Object Environment
  • 21. for ( 1 .. 3 ) { POE::Session -> create( inline_states => { _start => sub { print quot;Start!nquot; }, _stop => sub { print quot;Stop!nquot; } } ); } POE - A Perl Object Environment
  • 22. POE::Kernel->run(); POE - A Perl Object Environment
  • 23. _start Session Kernel POE - A Perl Object Environment
  • 24. _start Session _start => sub { print quot;Start!nquot; Kernel } POE - A Perl Object Environment
  • 25. Passaggio di messaggi Accoda un evento, da inoltrare post() alla session specificata Accoda un evento, da inoltrare yield() alla session stessa Invoca - in maniera sincrona - un evento per una call() sessione specificata POE - A Perl Object Environment
  • 26. Passaggio di messaggi post()/yield() POE - A Perl Object Environment
  • 27. Passaggio di messaggi call() POE - A Perl Object Environment
  • 28. Comunicazione tra sessioni POE - A Perl Object Environment
  • 29. # Sessione Babbo Natale POE::Session->create( inline_states => { _start => sub { print quot;Oh oh oh!nquot;; $poe_kernel->alias_set( quot;Santaquot; ); }, lettera => sub { print quot;Lettera da quot; . $poe_kernel->alias_list( $_[SENDER] ); } } ); POE - A Perl Object Environment
  • 30. # Sessione Babbo Natale POE::Session->create( inline_states => { _start => sub { print quot;Oh oh oh!nquot;; $poe_kernel->alias_set( quot;Santaquot; ); }, lettera => sub { print quot;Lettera da quot; . $poe_kernel->alias_list( $_[SENDER] ); } } ); POE - A Perl Object Environment
  • 31. # Sessione Babbo Natale POE::Session->create( inline_states => { _start => sub { print quot;Oh oh oh!nquot;; $poe_kernel->alias_set( quot;Santaquot; ); }, lettera => sub { print quot;Lettera da quot; . $poe_kernel->alias_list( $_[SENDER] ); } } ); POE - A Perl Object Environment
  • 32. # Sessione Babbo Natale POE::Session->create( inline_states => { _start => sub { print quot;Oh oh oh!nquot;; $poe_kernel->alias_set( quot;Santaquot; ); }, lettera => sub { print quot;Lettera da quot; . $poe_kernel->alias_list( $_[SENDER] ); } } ); POE - A Perl Object Environment
  • 33. # Sessione bimbo POE::Session->create( inline_states => { _start => sub { $poe_kernel->alias_set( quot;Paolinoquot; ); $poe_kernel->post( quot;Santaquot; => 'lettera' ); }, } ); POE - A Perl Object Environment
  • 34. # Sessione bimbo POE::Session->create( inline_states => { _start => sub { $poe_kernel->alias_set( quot;Paolinoquot; ); $poe_kernel->post( quot;Santaquot; => 'lettera' ); }, } ); POE - A Perl Object Environment
  • 35. Babbo Natale _start Kernel Paolino _start POE - A Perl Object Environment
  • 36. Babbo Natale Kernel Paolino post( quot;Santaquot;, quot;letteraquot; ) POE - A Perl Object Environment
  • 37. lettera Babbo Natale Kernel Paolino POE - A Perl Object Environment
  • 38. lettera Babbo Natale lettera Kernel Paolino post( quot;Santaquot;, quot;letteraquot; ) POE - A Perl Object Environment
  • 39. POE - A Perl Object Environment
  • 40. Wheel POE - A Perl Object Environment
  • 41. Insiemi di gestori di eventi POE - A Perl Object Environment
  • 42. POE:: Wheel:: FollowTail POE - A Perl Object Environment
  • 43. use POE qw( Wheel::FollowTail ); POE - A Perl Object Environment
  • 44. $|++ POE - A Perl Object Environment
  • 45. POE::Session-create( inline_states = {... POE - A Perl Object Environment
  • 46. _start = sub { my $heap = $_[ HEAP ]; my $watcher = POE::Wheel::FollowTail-new( Filename = 'logfile.log', PollInterval = 1, InputEvent = 'input_state' ); $heap-{ watcher } = $watcher; } , ... POE - A Perl Object Environment
  • 47. _start = sub { my $heap = $_[ HEAP ]; my $watcher = POE::Wheel::FollowTail-new( Filename = 'logfile.log', PollInterval = 1, InputEvent = 'input_state' ); $heap-{ watcher } = $watcher; } , ... POE - A Perl Object Environment
  • 48. _start = sub { my $heap = $_[ HEAP ]; my $watcher = POE::Wheel::FollowTail-new( Filename = 'logfile.log', PollInterval = 1, InputEvent = 'input_state' ); $heap-{ watcher } = $watcher; } , ... POE - A Perl Object Environment
  • 49. _start = sub { my $heap = $_[ HEAP ]; my $watcher = POE::Wheel::FollowTail-new( Filename = 'logfile.log', PollInterval = 1, InputEvent = 'input_state' ); $heap-{ watcher } = $watcher; } , ... POE - A Perl Object Environment
  • 50. _start = sub { my $heap = $_[ HEAP ]; my $watcher = POE::Wheel::FollowTail-new( Filename = 'logfile.log', PollInterval = 1, InputEvent = 'input_state' ); $heap-{ watcher } = $watcher; } , ... POE - A Perl Object Environment
  • 51. input_state = sub { my $input = $_[ ARG0 ]; print $input; } POE - A Perl Object Environment
  • 53. Session __________ __________ __________ input_event __________ __________ __________ Wheel POE - A Perl Object Environment
  • 54. POE - A Perl Object Environment
  • 55. POE + Test + IRC POE - A Perl Object Environment
  • 56. Testing? POE - A Perl Object Environment
  • 57. Failed 3/10 tests ? Test IRC POE - A Perl Object Environment
  • 58. 09:41 Quinn larsen: Avast! Whoreson swab! You failed 3/10 tests! POE - A Perl Object Environment
  • 59. ? Test IRC POE - A Perl Object Environment
  • 60. Session POE:: Wheel:: __________ FollowTail __________ __________ __________ __________ __________ POE:: Component:: IRC POE - A Perl Object Environment
  • 61. POE:: Component:: IRC POE - A Perl Object Environment
  • 62. use POE qw/ Wheel::FollowTail Component::IRC /; POE - A Perl Object Environment
  • 63. use Acme::Scurvy::Whoreson::BilgeRat; POE - A Perl Object Environment
  • 64. my $conf = { nick = 'Quinn', ircname = 'HAR!', server = 'irc.freenode.net', port = 6667 }; my $channel = '#scummbar'; POE - A Perl Object Environment
  • 65. my $irc = POE::Component::IRC-spawn( %$conf ) or die quot;HAR!!! $!quot;; POE - A Perl Object Environment
  • 66. POE::Session-create( package_states = [ 'main' = [ qw( _default _start irc_001 irc_public tell_results ) ], ], heap = { irc = $irc } ); POE - A Perl Object Environment
  • 67. POE::Session-create( package_states = [ 'main' = [ qw( _default _start irc_001 irc_public tell_results ) ], ], heap = { irc = $irc } ); POE - A Perl Object Environment
  • 68. POE::Session-create( package_states = [ 'main' = [ qw( _default _start irc_001 irc_public tell_results ) ], ], heap = { irc = $irc } ); POE - A Perl Object Environment
  • 69. sub _start { my ( $kernel, $heap ) = @_[ KERNEL, HEAP ]; my $watcher = POE::Wheel::FollowTail-new( Filename = 'tests.log' , PollInterval = 1 , InputEvent = 'tell_results' ); $heap-{ watcher } = $watcher; my $irc_sess = $heap-{irc}-session_id(); $kernel-post( $irc_sess = register = 'all' ); $kernel-post( $irc_sess = connect = {} ); undef; } POE - A Perl Object Environment
  • 70. sub _start { my ( $kernel, $heap ) = @_[ KERNEL, HEAP ]; my $watcher = POE::Wheel::FollowTail-new( Filename = 'tests.log' , PollInterval = 1 , InputEvent = 'tell_results' ); $heap-{ watcher } = $watcher; my $irc_sess = $heap-{irc}-session_id(); $kernel-post( $irc_sess = register = 'all' ); $kernel-post( $irc_sess = connect = {} ); undef; } POE - A Perl Object Environment
  • 71. sub _start { my ( $kernel, $heap ) = @_[ KERNEL, HEAP ]; my $watcher = POE::Wheel::FollowTail-new( Filename = 'tests.log' , PollInterval = 1 , InputEvent = 'tell_results' ); $heap-{ watcher } = $watcher; my $irc_sess = $heap-{irc}-session_id(); $kernel-post( $irc_sess = register = 'all' ); $kernel-post( $irc_sess = connect = {} ); undef; } POE - A Perl Object Environment
  • 72. sub irc_001 { my ( $kernel, $sender ) = @_[ KERNEL, SENDER ]; $kernel-post( $sender = join = $channel ); undef; } POE - A Perl Object Environment
  • 73. sub tell_results { my $kernel = $_[KERNEL]; my $heap = $_[HEAP]; my $line = $_[ARG0]; my $irc_session = $heap-{irc}; my ($failed, $total) = split qr|/|, $line; if ($failed) { my $insult = Acme::Scurvy::Whoreson::BilgeRat-new( language = 'pirate' ); $kernel-post( $irc_session = privmsg = $channel = quot;$insult! You failed $failed tests!quot; ); } } } POE - A Perl Object Environment
  • 74. sub tell_results { my $kernel = $_[KERNEL]; my $heap = $_[HEAP]; my $line = $_[ARG0]; my $irc_session = $heap-{irc}; my ($failed, $total) = split qr|/|, $line; if ($failed) { my $insult = Acme::Scurvy::Whoreson::BilgeRat-new( language = 'pirate' ); $kernel-post( $irc_session = privmsg = $channel = quot;$insult! You failed $failed tests!quot; ); } } } POE - A Perl Object Environment
  • 75. sub tell_results { my $kernel = $_[KERNEL]; my $heap = $_[HEAP]; my $line = $_[ARG0]; my $irc_session = $heap-{irc}; my ($failed, $total) = split qr|/|, $line; if ($failed) { my $insult = Acme::Scurvy::Whoreson::BilgeRat-new( language = 'pirate' ); $kernel-post( $irc_session = privmsg = $channel = quot;$insult! You failed $failed tests!quot; ); } } } POE - A Perl Object Environment
  • 76. POE - A Perl Object Environment
  • 77. • irc.freenode.net,#poe • http://poe.perl.org • “Advanced Perl Programming” (O’Reilly) - Cap.7 • http://del.icio.us/slr/poe ☺ POE - A Perl Object Environment
  • 78. • http://www.perl.it • irc.freenode.net,#perl.it • mongers@perl.it POE - A Perl Object Environment
  • 79. Grazie! Stefano Rodighiero larsen@perl.it