ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Coro/Coro/Handle.pm
(Generate patch)

Comparing Coro/Coro/Handle.pm (file contents):
Revision 1.14 by root, Mon Nov 20 19:56:03 2006 UTC vs.
Revision 1.15 by root, Fri Dec 1 02:17:37 2006 UTC

309 fh => $_[0][0], 309 fh => $_[0][0],
310 desc => "$_[0][1] readable", 310 desc => "$_[0][1] readable",
311 poll => 'r', 311 poll => 'r',
312 cb => sub { 312 cb => sub {
313 $current->ready; 313 $current->ready;
314 undef $current;
314 }, 315 },
315 ); 316 );
316 317
317 my $t = $_[0][2] && AnyEvent->timer ( 318 my $t = $_[0][2] && AnyEvent->timer (
318 after => $_[0][2], 319 after => $_[0][2],
319 cb => sub { 320 cb => sub {
320 $io = 0; 321 $io = 0;
321 $current->ready; 322 $current->ready;
323 undef $current;
322 }, 324 },
323 ); 325 );
324 326
325 &Coro::schedule; 327 &Coro::schedule;
328 &Coro::schedule while $current;
329
326 $io 330 $io
327} 331}
328 332
329sub writable { 333sub writable {
330 my $current = $Coro::current; 334 my $current = $Coro::current;
334 fh => $_[0][0], 338 fh => $_[0][0],
335 desc => "$_[0][1] writable", 339 desc => "$_[0][1] writable",
336 poll => 'w', 340 poll => 'w',
337 cb => sub { 341 cb => sub {
338 $current->ready; 342 $current->ready;
343 undef $current;
339 }, 344 },
340 ); 345 );
341 346
342 my $t = $_[0][2] && AnyEvent->timer ( 347 my $t = $_[0][2] && AnyEvent->timer (
343 after => $_[0][2], 348 after => $_[0][2],
344 cb => sub { 349 cb => sub {
345 $io = 0; 350 $io = 0;
346 $current->ready; 351 $current->ready;
352 undef $current;
347 }, 353 },
348 ); 354 );
349 355
350 &Coro::schedule; 356 &Coro::schedule while $current;
357
351 $io 358 $io
352} 359}
353 360
354sub WRITE { 361sub WRITE {
355 my $len = defined $_[2] ? $_[2] : length $_[1]; 362 my $len = defined $_[2] ? $_[2] : length $_[1];

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines