summaryrefslogtreecommitdiff
path: root/ev.3
diff options
context:
space:
mode:
authorroot <root>2007-11-29 12:21:05 +0000
committerroot <root>2007-11-29 12:21:05 +0000
commit8d0f4d263d9a5601bb7d419e7db00970e288cb7e (patch)
treef1eb4dde57119a2d01d733eb8d897414e7720a52 /ev.3
parente036fde31e607a47af3e63e9c23cef34d88a2582 (diff)
many fixes to event emulation
Diffstat (limited to 'ev.3')
-rw-r--r--ev.330
1 files changed, 16 insertions, 14 deletions
diff --git a/ev.3 b/ev.3
index 9e1c613..d7652a3 100644
--- a/ev.3
+++ b/ev.3
@@ -129,7 +129,7 @@
.\" ========================================================================
.\"
.IX Title ""<STANDARD INPUT>" 1"
-.TH "<STANDARD INPUT>" 1 "2007-11-28" "perl v5.8.8" "User Contributed Perl Documentation"
+.TH "<STANDARD INPUT>" 1 "2007-11-29" "perl v5.8.8" "User Contributed Perl Documentation"
.SH "NAME"
libev \- a high performance full\-featured event loop written in C
.SH "SYNOPSIS"
@@ -1073,23 +1073,25 @@ timer will not fire more than once per event loop iteration.
This will act as if the timer timed out and restart it again if it is
repeating. The exact semantics are:
.Sp
-If the timer is started but nonrepeating, stop it.
+If the timer is pending, its pending status is cleared.
.Sp
-If the timer is repeating, either start it if necessary (with the repeat
-value), or reset the running timer to the repeat value.
+If the timer is started but nonrepeating, stop it (as if it timed out).
+.Sp
+If the timer is repeating, either start it if necessary (with the
+\&\f(CW\*(C`repeat\*(C'\fR value), or reset the running timer to the \f(CW\*(C`repeat\*(C'\fR value.
.Sp
This sounds a bit complicated, but here is a useful and typical
-example: Imagine you have a tcp connection and you want a so-called
-idle timeout, that is, you want to be called when there have been,
-say, 60 seconds of inactivity on the socket. The easiest way to do
-this is to configure an \f(CW\*(C`ev_timer\*(C'\fR with \f(CW\*(C`after\*(C'\fR=\f(CW\*(C`repeat\*(C'\fR=\f(CW60\fR and calling
+example: Imagine you have a tcp connection and you want a so-called idle
+timeout, that is, you want to be called when there have been, say, 60
+seconds of inactivity on the socket. The easiest way to do this is to
+configure an \f(CW\*(C`ev_timer\*(C'\fR with a \f(CW\*(C`repeat\*(C'\fR value of \f(CW60\fR and then call
\&\f(CW\*(C`ev_timer_again\*(C'\fR each time you successfully read or write some data. If
you go into an idle state where you do not expect data to travel on the
-socket, you can stop the timer, and again will automatically restart it if
-need be.
+socket, you can \f(CW\*(C`ev_timer_stop\*(C'\fR the timer, and \f(CW\*(C`ev_timer_again\*(C'\fR will
+automatically restart it if need be.
.Sp
-You can also ignore the \f(CW\*(C`after\*(C'\fR value and \f(CW\*(C`ev_timer_start\*(C'\fR altogether
-and only ever use the \f(CW\*(C`repeat\*(C'\fR value:
+That means you can ignore the \f(CW\*(C`after\*(C'\fR value and \f(CW\*(C`ev_timer_start\*(C'\fR
+altogether and only ever use the \f(CW\*(C`repeat\*(C'\fR value and \f(CW\*(C`ev_timer_again\*(C'\fR:
.Sp
.Vb 8
\& ev_timer_init (timer, callback, 0., 5.);
@@ -1102,8 +1104,8 @@ and only ever use the \f(CW\*(C`repeat\*(C'\fR value:
\& ev_timer_again (loop, timer);
.Ve
.Sp
-This is more efficient then stopping/starting the timer eahc time you want
-to modify its timeout value.
+This is more slightly efficient then stopping/starting the timer each time
+you want to modify its timeout value.
.IP "ev_tstamp repeat [read\-write]" 4
.IX Item "ev_tstamp repeat [read-write]"
The current \f(CW\*(C`repeat\*(C'\fR value. Will be used each time the watcher times out