… | |
… | |
419 | might imply, do anything with POSIX signals). |
419 | might imply, do anything with POSIX signals). |
420 | |
420 | |
421 | C<$value> must be in the valid range for a C<sig_atomic_t>, except C<0> |
421 | C<$value> must be in the valid range for a C<sig_atomic_t>, except C<0> |
422 | (1..127 is portable). |
422 | (1..127 is portable). |
423 | |
423 | |
|
|
424 | =item $async->handle |
|
|
425 | |
|
|
426 | Calls the callback if the object is pending. |
|
|
427 | |
|
|
428 | This method does not need to be called normally, as it will be invoked |
|
|
429 | automatically. However, it can be used to force handling of outstanding |
|
|
430 | interrupts while the object is blocked. |
|
|
431 | |
|
|
432 | One reason why one might want to do that is when you want to switch |
|
|
433 | from asynchronous interruptions to synchronous one, using e.g. an event |
|
|
434 | loop. To do that, one would first C<< $async->block >> the interrupt |
|
|
435 | object, then register a read watcher on the C<pipe_fileno> that calls C<< |
|
|
436 | $async->handle >>. |
|
|
437 | |
|
|
438 | This disables asynchronous interruptions, but ensures that interrupts are |
|
|
439 | handled by the event loop. |
|
|
440 | |
424 | =item $async->signal_hysteresis ($enable) |
441 | =item $async->signal_hysteresis ($enable) |
425 | |
442 | |
426 | Enables or disables signal hysteresis (default: disabled). If a POSIX |
443 | Enables or disables signal hysteresis (default: disabled). If a POSIX |
427 | signal is used as a signal source for the interrupt object, then enabling |
444 | signal is used as a signal source for the interrupt object, then enabling |
428 | signal hysteresis causes Async::Interrupt to reset the signal action to |
445 | signal hysteresis causes Async::Interrupt to reset the signal action to |
… | |
… | |
510 | draining. |
527 | draining. |
511 | |
528 | |
512 | This is useful when you want to share one pipe among many Async::Interrupt |
529 | This is useful when you want to share one pipe among many Async::Interrupt |
513 | objects. |
530 | objects. |
514 | |
531 | |
|
|
532 | =item $async->pipe_drain |
|
|
533 | |
|
|
534 | Drains the pipe manually, for example, when autodrain is disabled. Does |
|
|
535 | nothing when no pipe is enabled. |
|
|
536 | |
515 | =item $async->post_fork |
537 | =item $async->post_fork |
516 | |
538 | |
517 | The object will not normally be usable after a fork (as the pipe fd is |
539 | The object will not normally be usable after a fork (as the pipe fd is |
518 | shared between processes). Calling this method after a fork in the child |
540 | shared between processes). Calling this method after a fork in the child |
519 | ensures that the object will work as expected again. It only needs to be |
541 | ensures that the object will work as expected again. It only needs to be |