View on
MetaCPAN
search.cpan.org is shutting down
For details read Perl NOC. After June 25th this page will redirect to MetaCPAN.org
Jacques Germishuys > ZMQ-Raw-0.22 > ZMQ::Raw::Loop::Timer

Download:
ZMQ-Raw-0.22.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.22   Source   Latest Release: ZMQ-Raw-0.25

NAME ^

ZMQ::Raw::Loop::Timer - Timer class

VERSION ^

version 0.22

DESCRIPTION ^

A ZMQ::Raw::Loop::Timer represents a timer, usable in a ZMQ::Raw::Loop.

WARNING: The API of this module is unstable and may change without warning (any change will be appropriately documented in the changelog).

SYNOPSIS ^

        use ZMQ::Raw;

        my $context = ZMQ::Raw::Context->new;
        my $loop = ZMQ::Raw::Loop->new ($context);

        my $timer = ZMQ::Raw::Loop::Timer->new
        (
                timer => ZMQ::Raw::Timer->new ($context, after => 100),
                on_timeout => sub
                {
                        print "Timed out!\n";
                        $loop->terminate();
                },
        );

        $loop->add ($timer);
        $loop->run;

METHODS ^

new( )

Create a new loop timer.

cancel( )

Cancel the underlying timer.

reset( )

Reset the underlying timer.

expire( )

Expire the underlying timer.

running( )

Check if the timer is running.

AUTHOR ^

Jacques Germishuys <jacquesg@striata.com>

LICENSE AND COPYRIGHT ^

Copyright 2017 Jacques Germishuys.

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See http://dev.perl.org/licenses/ for more information.

syntax highlighting: