Hi,

if I have (roughly) the code below.  I can interact with the server from a
client, but is there anyway for me to get the server to run "some_process()"
routinely, __without__ any client interaction.

Thanks
Jay

#!/usr/bin/perl

use warnings;
use strict;
use POE qw(Component::Server::TCP);
use Net::Server::Daemonize qw(daemonize);

daemonize('nobody','nobody','/var/mydaemon.pid');

POE::Component::Server::TCP->new(
    Address         => "localhost",
    Port            => 12345,
    ClientFilter    => "POE::Filter::Reference",
    ClientInput     => \&clientInput
);

$poe_kernel->run();

sub clientInput {
    my ( $heap, $list ) = @_[ HEAP, ARG0 ];
    my @symbol = ref $list eq "ARRAY" ? @$list : $list;
    my $return = some_process(@symbol);
    $heap->{client}->put(\$return);
}

sub some_process {
    my @list;
    # do something with the list
    return $return;
}


Reply via email to