NAME

POEIKCdaemon - POE IKC daemon

SYNOPSIS

poeikcd

poeikcd start -p=47225 
poeikcd stop  -p=47225 
poeikcd --help

And then pikc (POK IKC Client)

	pikc --help

    pikc -H remote_hostname -p=47225 -a=POEIKCd -s=m -o=y MyClass my_method args1 args2

    pikc -s=method_respond POEIKCdaemon::Utility get_VERSION
    pikc -s m POEIKCdaemon::Utility get_A_INC -o d
    pikc -s m POEIKCdaemon::Utility get_H_ENV -o y
    pikc -s=function_respond LWP::Simple get http://search.cpan.org/~suzuki/
    pikc -s=eval_respond 'scalar `ps ux`'

or use POE::Component::IKC::ClientLite

use POE::Component::IKC::ClientLite;
use Data::Dumper;

my $host = '127.0.0.1';
my $port = $ARGV[0] || 47225;

print scalar localtime,"\n";
printf "[ %s : %s ]\n", $host, $port;
my ($name) = $0 =~ /(\w+)\.\w+/;
$name .= $$;
my $ikc = create_ikc_client(
	ip => $host,
	port => $port,
	name => $name,
);
my $ret;

$ikc or die sprintf "%s\n\n",$POE::Component::IKC::ClientLite::error;

# method_respond
$ret = $ikc->post_respond('POEIKCd/method_respond' => 
	['Cwd' => 'getcwd']
);
$ikc->error and die($ikc->error);
print Dumper $ret;

# function_respond
$ret = $ikc->post_respond('POEIKCd/function_respond' => 
	['LWP::Simple' => 'get', 'http://search.cpan.org/~suzuki/']
);
$ikc->error and die($ikc->error);
print Dumper $ret;

$ret = $ikc->post_respond('POEIKCd/method_respond' => 
	['MyClass' => 'my_method', 'args1', 'args2', 'args3 ..' ]
);
$ikc->error and die($ikc->error);
print Dumper $ret;

# reload
$ret = $ikc->post_respond('POEIKCd/method_respond' => 
	['POEIKCdaemon::Utility'=> 'reload', 'MyClass'=> 'my_method']
);
$ikc->error and die($ikc->error);
print Dumper $ret;

# stay , It is not reload.
$ret = $ikc->post_respond('POEIKCd/method_respond' => 
	['POEIKCdaemon::Utility' => 'stay', 'MyClass' ]
);
$ikc->error and die($ikc->error);
print Dumper $ret;
print '* 'x20,"\n";

$ret = $ikc->post_respond('POEIKCd/method_respond' => 
	['POEIKCdaemon::Utility' => 'get_A_INC']
);
$ikc->error and die($ikc->error);
print Dumper $ret;
print '* 'x20,"\n";

# @INC It can change. unshift @INC
$ret = $ikc->post_respond('POEIKCd/method_respond' => 
	['POEIKCdaemon::Utility' => 'unshift_INC', '~/lib'],
);
$ikc->error and die($ikc->error);
print Dumper $ret;
print '* 'x20,"\n";

$ret = $ikc->post_respond('POEIKCd/method_respond' => 
		['POEIKCdaemon::Utility' => 'reset_INC'],
);
$ikc->error and die($ikc->error);
print Dumper $ret;
print '* 'x20,"\n";

# shutdown
$ret = $ikc->post_respond('POEIKCd/method_respond' => 
	['POEIKCdaemon::Utility' => 'stop']
);
$ikc->error and die($ikc->error);
print Dumper $ret;

DESCRIPTION

POEIKCdaemon is daemon of POE::Component::IKC

AUTHOR

Yuji Suzuki <yuji.suzuki.perl@gmail.com>

LICENSE

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

SEE ALSO

POE::Component::IKC::ClientLite