GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  CORO::TIMER (3)

.ds Aq ’

NAME

Coro::Timer - timers and timeouts, independent of any event loop

CONTENTS

SYNOPSIS



 # This package is mostly obsoleted by Coro::AnyEvent.

 use Coro::Timer qw(timeout);
 # nothing exported by default



DESCRIPTION

This package has been mostly obsoleted by Coro::AnyEvent, the only really useful function left in here is timeout.
$flag = timeout $seconds This function will wake up the current coroutine after $seconds seconds and sets $flag to true (it is false initially). If $flag goes out of scope earlier then nothing happens.

This is used by Coro itself to implement the timed_down, timed_wait etc. primitives. It is used like this:



   sub timed_wait {
      my $timeout = Coro::Timer::timeout 60;

      while (condition false) {
         Coro::schedule; # wait until woken up or timeout
         return 0 if $timeout; # timed out
      }

      return 1; # condition satisfied
   }



AUTHOR/SUPPORT/CONTACT



   Marc A. Lehmann <schmorp@schmorp.de>
   http://software.schmorp.de/pkg/Coro.html



Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 TIMER (3) 2015-10-16

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.