… | |
… | |
236 | # the next line forces initialisation of internal |
236 | # the next line forces initialisation of internal |
237 | # signal handling variables, otherwise, PL_sig_pending |
237 | # signal handling variables, otherwise, PL_sig_pending |
238 | # etc. will be null pointers. |
238 | # etc. will be null pointers. |
239 | $SIG{KILL} = sub { }; |
239 | $SIG{KILL} = sub { }; |
240 | |
240 | |
241 | our $VERSION = '1.0'; |
241 | our $VERSION = '1.01'; |
242 | |
242 | |
243 | require XSLoader; |
243 | require XSLoader; |
244 | XSLoader::load ("Async::Interrupt", $VERSION); |
244 | XSLoader::load ("Async::Interrupt", $VERSION); |
245 | } |
245 | } |
246 | |
246 | |
… | |
… | |
576 | |
576 | |
577 | =item $epipe->drain |
577 | =item $epipe->drain |
578 | |
578 | |
579 | Drain (empty) the pipe. |
579 | Drain (empty) the pipe. |
580 | |
580 | |
|
|
581 | =item ($c_func, $c_arg) = $epipe->drain_func |
|
|
582 | |
|
|
583 | Returns a function pointer and C<void *> argument that can be called to |
|
|
584 | have the effect of C<< $epipe->drain >> on the XS level. |
|
|
585 | |
|
|
586 | It has the following prototype and needs to be passed the specified |
|
|
587 | C<$c_arg>, which is a C<void *> cast to C<IV>: |
|
|
588 | |
|
|
589 | void (*c_func) (void *c_arg) |
|
|
590 | |
|
|
591 | An example call would look like: |
|
|
592 | |
|
|
593 | c_func (c_arg); |
|
|
594 | |
581 | =item $epipe->renew |
595 | =item $epipe->renew |
582 | |
596 | |
583 | Recreates the pipe (useful after a fork). The reading side will not change |
597 | Recreates the pipe (useful after a fork). The reading side will not change |
584 | it's file descriptor number, but the writing side might. |
598 | it's file descriptor number, but the writing side might. |
585 | |
599 | |
|
|
600 | =item $epipe->wait |
|
|
601 | |
|
|
602 | This method blocks the process until there are events on the pipe. This is |
|
|
603 | not a very event-based or ncie way of usign an event pipe, but it can be |
|
|
604 | occasionally useful. |
|
|
605 | |
586 | =back |
606 | =back |
587 | |
607 | |
588 | =cut |
608 | =cut |
589 | |
609 | |
590 | 1; |
610 | 1; |
591 | |
|
|
592 | =head1 EXAMPLE |
|
|
593 | |
|
|
594 | There really should be a complete C/XS example. Bug me about it. Better |
|
|
595 | yet, create one. |
|
|
596 | |
611 | |
597 | =head1 IMPLEMENTATION DETAILS AND LIMITATIONS |
612 | =head1 IMPLEMENTATION DETAILS AND LIMITATIONS |
598 | |
613 | |
599 | This module works by "hijacking" SIGKILL, which is guaranteed to always |
614 | This module works by "hijacking" SIGKILL, which is guaranteed to always |
600 | exist, but also cannot be caught, so is always available. |
615 | exist, but also cannot be caught, so is always available. |