# warning: completely untested { package AnyEvent::Impl::Prima; sub io { my($s, %r) = @_; Prima::File->new(file => $r{fh}, mask => ("w" eq $r{poll} ? fe::Write() : fe::Read()) | fe::Exception, onRead=>$r{cb},onWrite=>$r{cb},onException=>$r{cb}) } sub timer { my($s ,%r) = @_; my($c,$g) = $r{cb}; $r{interval} and die "error: repeated timers not supported in AnyEvent::Impl::Prima"; Prima::Timer->new(timeout=>$r{after}, onTick => sub{ my($i)=@_; $i->stop; $g++ or &$c() }) } push @AnyEvent::REGISTRY,["Prima",__PACKAGE__]; }