ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/AnyEvent-MPV/MPV.pm
(Generate patch)

Comparing AnyEvent-MPV/MPV.pm (file contents):
Revision 1.13 by root, Mon Mar 20 14:42:40 2023 UTC vs.
Revision 1.14 by root, Mon Mar 20 22:10:37 2023 UTC

695You can register multiple handlers for the same event, and this method 695You can register multiple handlers for the same event, and this method
696does not interfere with the C<on_event> mechanism. That is, you can 696does not interfere with the C<on_event> mechanism. That is, you can
697completely ignore this method and handle events in a C<on_event> handler, 697completely ignore this method and handle events in a C<on_event> handler,
698or mix both approaches as you see fit. 698or mix both approaches as you see fit.
699 699
700Note that unlike commands, event handlers are registered immediately, that
701is, you can issue a command, then register an event handler and then get
702an event for this handler I<before> the command is even sent to F<mpv>. If
703this kind of race is an issue, you can issue a dummy command such as
704C<get_version> and register the handler when the reply is received.
705
700=cut 706=cut
701 707
702sub AnyEvent::MPV::Unevent::DESTROY { 708sub AnyEvent::MPV::Unevent::DESTROY {
703 my ($evtcb, $event, $evtid) = @{$_[0]}; 709 my ($evtcb, $event, $evtid) = @{$_[0]};
704 delete $evtcb->{$event}{$evtid}; 710 delete $evtcb->{$event}{$evtid};

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines