ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/AnyEvent/README
(Generate patch)

Comparing AnyEvent/README (file contents):
Revision 1.8 by root, Mon Dec 11 01:16:09 2006 UTC vs.
Revision 1.11 by root, Tue Nov 6 16:42:05 2007 UTC

148 $result_ready->wait; 148 $result_ready->wait;
149 149
150 SIGNAL WATCHERS 150 SIGNAL WATCHERS
151 You can listen for signals using a signal watcher, "signal" is the 151 You can listen for signals using a signal watcher, "signal" is the
152 signal *name* without any "SIG" prefix. Multiple signals events can be 152 signal *name* without any "SIG" prefix. Multiple signals events can be
153 clumped together into one callback invocation, and callbakc invocation 153 clumped together into one callback invocation, and callback invocation
154 might or might not be asynchronous. 154 might or might not be asynchronous.
155 155
156 These watchers might use %SIG, so programs overwriting those signals 156 These watchers might use %SIG, so programs overwriting those signals
157 directly will likely not work correctly. 157 directly will likely not work correctly.
158 158
160 160
161 my $w = AnyEvent->signal (signal => "INT", cb => sub { exit 1 }); 161 my $w = AnyEvent->signal (signal => "INT", cb => sub { exit 1 });
162 162
163 CHILD PROCESS WATCHERS 163 CHILD PROCESS WATCHERS
164 You can also listen for the status of a child process specified by the 164 You can also listen for the status of a child process specified by the
165 "pid" argument. The watcher will only trigger once. This works by 165 "pid" argument (or any child if the pid argument is 0). The watcher will
166 trigger as often as status change for the child are received. This works
166 installing a signal handler for "SIGCHLD". 167 by installing a signal handler for "SIGCHLD". The callback will be
168 called with the pid and exit status (as returned by waitpid).
167 169
168 Example: wait for pid 1333 170 Example: wait for pid 1333
169 171
170 my $w = AnyEvent->child (pid => 1333, cb => sub { warn "exit status $?" }); 172 my $w = AnyEvent->child (pid => 1333, cb => sub { warn "exit status $?" });
171 173
177 the "AnyEvent::Impl:xxx" modules, but can be any other class in the 179 the "AnyEvent::Impl:xxx" modules, but can be any other class in the
178 case AnyEvent has been extended at runtime (e.g. in *rxvt-unicode*). 180 case AnyEvent has been extended at runtime (e.g. in *rxvt-unicode*).
179 181
180 The known classes so far are: 182 The known classes so far are:
181 183
184 EV::AnyEvent based on EV (an interface to libev, best choice)
182 AnyEvent::Impl::Coro based on Coro::Event, best choise. 185 AnyEvent::Impl::Coro based on Coro::Event, second best choice.
183 AnyEvent::Impl::Event based on Event, also best choice :) 186 AnyEvent::Impl::Event based on Event, also second best choice :)
184 AnyEvent::Impl::Glib based on Glib, second-best choice. 187 AnyEvent::Impl::Glib based on Glib, second-best choice.
185 AnyEvent::Impl::Tk based on Tk, very bad choice. 188 AnyEvent::Impl::Tk based on Tk, very bad choice.
186 AnyEvent::Impl::Perl pure-perl implementation, inefficient. 189 AnyEvent::Impl::Perl pure-perl implementation, inefficient.
187 190
188 AnyEvent::detect 191 AnyEvent::detect
249 *rxvt-unicode* distribution. 252 *rxvt-unicode* distribution.
250 253
251 *rxvt-unicode* also cheats a bit by not providing blocking access to 254 *rxvt-unicode* also cheats a bit by not providing blocking access to
252 condition variables: code blocking while waiting for a condition will 255 condition variables: code blocking while waiting for a condition will
253 "die". This still works with most modules/usages, and blocking calls 256 "die". This still works with most modules/usages, and blocking calls
254 must not be in an interactive appliation, so it makes sense. 257 must not be in an interactive application, so it makes sense.
255 258
256ENVIRONMENT VARIABLES 259ENVIRONMENT VARIABLES
257 The following environment variables are used by this module: 260 The following environment variables are used by this module:
258 261
259 "PERL_ANYEVENT_VERBOSE" when set to 2 or higher, reports which event 262 "PERL_ANYEVENT_VERBOSE" when set to 2 or higher, reports which event

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines