ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/libev/ev.pod
(Generate patch)

Comparing libev/ev.pod (file contents):
Revision 1.314 by root, Fri Oct 22 06:06:31 2010 UTC vs.
Revision 1.318 by root, Fri Oct 22 09:40:22 2010 UTC

124this argument. 124this argument.
125 125
126=head2 TIME REPRESENTATION 126=head2 TIME REPRESENTATION
127 127
128Libev represents time as a single floating point number, representing 128Libev represents time as a single floating point number, representing
129the (fractional) number of seconds since the (POSIX) epoch (in practise 129the (fractional) number of seconds since the (POSIX) epoch (in practice
130somewhere near the beginning of 1970, details are complicated, don't 130somewhere near the beginning of 1970, details are complicated, don't
131ask). This type is called C<ev_tstamp>, which is what you should use 131ask). This type is called C<ev_tstamp>, which is what you should use
132too. It usually aliases to the C<double> type in C. When you need to do 132too. It usually aliases to the C<double> type in C. When you need to do
133any calculations on it, you should treat it as some floating point value. 133any calculations on it, you should treat it as some floating point value.
134 134
165 165
166=item ev_tstamp ev_time () 166=item ev_tstamp ev_time ()
167 167
168Returns the current time as libev would use it. Please note that the 168Returns the current time as libev would use it. Please note that the
169C<ev_now> function is usually faster and also often returns the timestamp 169C<ev_now> function is usually faster and also often returns the timestamp
170you actually want to know. 170you actually want to know. Also interetsing is the combination of
171C<ev_update_now> and C<ev_now>.
171 172
172=item ev_sleep (ev_tstamp interval) 173=item ev_sleep (ev_tstamp interval)
173 174
174Sleep for the given interval: The current thread will be blocked until 175Sleep for the given interval: The current thread will be blocked until
175either it is interrupted or the given time interval has passed. Basically 176either it is interrupted or the given time interval has passed. Basically
213 assert (("sorry, no epoll, no sex", 214 assert (("sorry, no epoll, no sex",
214 ev_supported_backends () & EVBACKEND_EPOLL)); 215 ev_supported_backends () & EVBACKEND_EPOLL));
215 216
216=item unsigned int ev_recommended_backends () 217=item unsigned int ev_recommended_backends ()
217 218
218Return the set of all backends compiled into this binary of libev and also 219Return the set of all backends compiled into this binary of libev and
219recommended for this platform. This set is often smaller than the one 220also recommended for this platform, meaning it will work for most file
221descriptor types. This set is often smaller than the one returned by
220returned by C<ev_supported_backends>, as for example kqueue is broken on 222C<ev_supported_backends>, as for example kqueue is broken on most BSDs
221most BSDs and will not be auto-detected unless you explicitly request it 223and will not be auto-detected unless you explicitly request it (assuming
222(assuming you know what you are doing). This is the set of backends that 224you know what you are doing). This is the set of backends that libev will
223libev will probe for if you specify no backends explicitly. 225probe for if you specify no backends explicitly.
224 226
225=item unsigned int ev_embeddable_backends () 227=item unsigned int ev_embeddable_backends ()
226 228
227Returns the set of backends that are embeddable in other event loops. This 229Returns the set of backends that are embeddable in other event loops. This
228is the theoretical, all-platform, value. To find which backends 230is the theoretical, all-platform, value. To find which backends
4875 4877
4876=over 4 4878=over 4
4877 4879
4878=item active 4880=item active
4879 4881
4880A watcher is active as long as it has been started (has been attached to 4882A watcher is active as long as it has been started and not yet stopped.
4881an event loop) but not yet stopped (disassociated from the event loop). 4883See L<WATCHER STATES> for details.
4882 4884
4883=item application 4885=item application
4884 4886
4885In this document, an application is whatever is using libev. 4887In this document, an application is whatever is using libev.
4888
4889=item backend
4890
4891The part of the code dealing with the operating system interfaces.
4886 4892
4887=item callback 4893=item callback
4888 4894
4889The address of a function that is called when some event has been 4895The address of a function that is called when some event has been
4890detected. Callbacks are being passed the event loop, the watcher that 4896detected. Callbacks are being passed the event loop, the watcher that
4891received the event, and the actual event bitset. 4897received the event, and the actual event bitset.
4892 4898
4893=item callback invocation 4899=item callback/watcher invocation
4894 4900
4895The act of calling the callback associated with a watcher. 4901The act of calling the callback associated with a watcher.
4896 4902
4897=item event 4903=item event
4898 4904
4917The model used to describe how an event loop handles and processes 4923The model used to describe how an event loop handles and processes
4918watchers and events. 4924watchers and events.
4919 4925
4920=item pending 4926=item pending
4921 4927
4922A watcher is pending as soon as the corresponding event has been detected, 4928A watcher is pending as soon as the corresponding event has been
4923and stops being pending as soon as the watcher will be invoked or its 4929detected. See L<WATCHER STATES> for details.
4924pending status is explicitly cleared by the application.
4925
4926A watcher can be pending, but not active. Stopping a watcher also clears
4927its pending status.
4928 4930
4929=item real time 4931=item real time
4930 4932
4931The physical time that is observed. It is apparently strictly monotonic :) 4933The physical time that is observed. It is apparently strictly monotonic :)
4932 4934
4939=item watcher 4941=item watcher
4940 4942
4941A data structure that describes interest in certain events. Watchers need 4943A data structure that describes interest in certain events. Watchers need
4942to be started (attached to an event loop) before they can receive events. 4944to be started (attached to an event loop) before they can receive events.
4943 4945
4944=item watcher invocation
4945
4946The act of calling the callback associated with a watcher.
4947
4948=back 4946=back
4949 4947
4950=head1 AUTHOR 4948=head1 AUTHOR
4951 4949
4952Marc Lehmann <libev@schmorp.de>, with repeated corrections by Mikael Magnusson. 4950Marc Lehmann <libev@schmorp.de>, with repeated corrections by Mikael Magnusson.

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines