POE::SAPI(3)

NAME
POE::SAPI - The simplified POE API

README
This software is ALPHA and very volatile, expect updates regularly

Ontop of it being alpha remember some of its sub dependants, namely "POE::SAPI::NetTools" are DEPENDANT on FreeBSD (the devel platform)

This will change for the Beta release; but at the moment there are more important developments to do.

SYNOPSIS
        #!/usr/bin/perl

        use warnings;
        use strict;

        use POE qw(SAPI);
        use POE::SAPI::HandySubs qw(pad);

        POE::Session->create(
                inline_states => {
                        _start  => \&init,
                        comm    => \&comm,
                },
        );

        POE::Kernel->run();
        exit;

        sub init {
                my ($kernel,$session,$heap) = @_[KERNEL,SESSION,HEAP];
                $heap->{SAPI} = POE::SAPI->new({ });            # Note no options yet
        }

        sub comm {
                my ($kernel,$session,$heap,$req) = @_[KERNEL,SESSION,HEAP,ARG0];

                $req->{src} = "UNKNOWN" if (!$req->{src});

                if (!$req->{type}) { $kernel->yield('comm',{ type=>"debug", level=>"critical", msg=>"Just passed a request with no type!", original=>$req }); }
                else {
                        if (($req->{level}) && ($req->{level} eq 'verbose')) { return; }
                        print "[" . pad($req->{src},12," ") . "], $req->{type}: $req->{msg}\n";
                }

                return if (!$req->{code});

                if ($req->{code} eq 'N_COREREADY') {
                        $kernel->yield('comm',{ type=>"debug", level=>"debug", msg=>"Core Ready - Initilizing config" } );
                        $kernel->post('SAPI','config',{ type=>"init" });
                }
        }

DESCRIPTION
Stub documentation for POE::SAPI, created by h2xs. It looks like the author of the extension was negligent enough to leave the stub unedited.

Blah blah blah.

  EXPORT
None by default.

SEE ALSO
"POE"

AUTHOR
Paul G Webster, <paul@daemonrage.net>

COPYRIGHT AND LICENSE
Copyright (C) 2011 by Paul G Webster

All rights reserved.

Redistribution and use in source and binary forms are permitted provided that the above copyright notice and this paragraph are duplicated in all such forms and that any documentation, advertising materials, and other materials related to such distribution and use acknowledge that the software was developed by the 'blank files'. The name of the University may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.