GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  POE::COMPONENT::HAILO (3)

.ds Aq ’

NAME

POE::Component::Hailo - A non-blocking wrapper around Hailo

CONTENTS

SYNOPSIS



 use strict;
 use warnings;
 use POE qw(Component::Hailo);

 POE::Session->create(
     package_states => [
         (__PACKAGE__) => [ qw(_start hailo_learned hailo_replied) ],
     ],
 );

 POE::Kernel->run;

 sub _start {
     POE::Component::Hailo->spawn(
         alias      => hailo,
         Hailo_args => {
             storage_class  => SQLite,
             brain_resource => hailo.sqlite,
         },
     );

     POE::Kernel->post(hailo => learn =>
         [This is a sentence],
     );
 }

 sub hailo_learned {
     POE::Kernel->post(hailo => reply => [This]);
 }

 sub hailo_replied {
     my $reply = $_[ARG0]->[0];
     die "Didnt get a reply" if !defined $reply;
     print "Got reply: $reply\n";
     POE::Kernel->post(hailo => shutdown);
 }



DESCRIPTION

POE::Component::Hailo is a POE component that provides a non-blocking wrapper around Hailo. It accepts the events listed under INPUT and emits the events listed under OUTPUT.

METHODS

CWspawn

This is the constructor. It takes the following arguments:

<B>’alias’B>, an optional alias for the component’s session.

<B>’Hailo_args’B>, a hash reference of arguments to pass to Hailo’s constructor.

<B>’options’B>, a hash reference of options to pass to POE::Session’s constructor.

CWsession_id

Takes no arguments. Returns the POE Session ID of the component.

INPUT

This component reacts to the following POE events:

CWlearn

CWtrain

CWreply

CWlearn_reply

CWstats

CWsave

All these events take two arguments. The first is an array reference of arguments which will be passed to the Hailo method of the same name. The second (optional) is a hash reference. You’ll get this hash reference back with the corresponding event listed under OUTPUT.

CWshutdown

Takes no arguments. Terminates the component.

OUTPUT

The component will post the following event to your session:

CWhailo_learned

CWhailo_trained

CWhailo_replied

CWhailo_learn_replied

CWhailo_stats

CWhailo_saved

ARG0 is an array reference of arguments returned by the underlying Hailo method. ARG1 is the context hashref you provided (if any).

AUTHOR

Hinrik Oern Sigurd`sson, hinrik.sig@gmail.com

LICENSE AND COPYRIGHT

Copyright 2010 Hinrik Oern Sigurd`sson

This program is free software, you can redistribute it and/or modify it under the same terms as Perl itself.

Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 POE::COMPONENT::HAILO (3) 2010-08-17

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.