NAME

POE::Stage::Ticker - a periodic message generator for POE::Stage

SYNOPSIS

$self->{req}{ticker} = POE::Stage::Ticker->new();
$self->{req}{request} = POE::Request->new(
	stage       => $self->{req}{ticker},
	method      => "start_ticking",
	on_tick     => "handle_tick",   # Invoke my handle_tick() method
	args        => {
		interval  => 10,              # every 10 seconds.
	},
);

sub handle_tick {
	my ($self, $args) = @_;
	print "Handled tick number $args->{id} in a series.\n";
}

DESCRIPTION

POE::Stage::Ticker emits recurring messages at a fixed interval.

PUBLIC COMMANDS

start_ticking (interval => FLOAT)

Used to request the Ticker to start ticking. The Ticker will emit a "tick" message every "interval" seconds.

PUBLIC RESPONSES

Responses are returned by POE::Request->return() or emit().

"tick" (id)

Once start_ticking() has been invoked, POE::Stage::Ticker emits a "tick" event. The "id" parameter is the ticker's unique ID, so that ticks from multiple tickers are not confused.

BUGS

See http://thirdlobe.com/projects/poe-stage/report/1 for known issues. See http://thirdlobe.com/projects/poe-stage/newticket to report one.

SEE ALSO

POE::Stage and POE::Request. The examples/many-responses.perl program in POE::Stage's distribution.

AUTHORS

Rocco Caputo <rcaputo@cpan.org>.

LICENSE

POE::Stage::Ticker is Copyright 2005 by Rocco Caputo. All rights are reserved. You may use, modify, and/or distribute this module under the same terms as Perl itself.