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

Comparing AnyEvent-SNMP/SNMP.pm (file contents):
Revision 1.11 by root, Sun Oct 31 18:26:27 2010 UTC vs.
Revision 1.12 by root, Sun Apr 15 11:02:07 2012 UTC

141 141
142# it is possible to do this without loading 142# it is possible to do this without loading
143# Net::SNMP::Dispatcher, but much more awkward. 143# Net::SNMP::Dispatcher, but much more awkward.
144use Net::SNMP::Dispatcher; 144use Net::SNMP::Dispatcher;
145 145
146# we could inherit fro Net:SNMP::Dispatcher, but since this is undocumented,
147# I'd rather see it die (and reported) than silenty and subtly fail.
148*msg_handle_alloc = \&Net::SNMP::Dispatcher::msg_handle_alloc;
149
146sub Net::SNMP::Dispatcher::instance { 150sub Net::SNMP::Dispatcher::instance {
147 AnyEvent::SNMP:: 151 AnyEvent::SNMP::
148} 152}
149 153
150use Net::SNMP (); 154use Net::SNMP ();
151use AnyEvent (); 155use AnyEvent ();
152 156
153our $VERSION = '1.0'; 157our $VERSION = '6.0';
154 158
155$Net::SNMP::DISPATCHER = instance Net::SNMP::Dispatcher; 159$Net::SNMP::DISPATCHER = instance Net::SNMP::Dispatcher;
156 160
157our $MESSAGE_PROCESSING = $Net::SNMP::Dispatcher::MESSAGE_PROCESSING; 161our $MESSAGE_PROCESSING = $Net::SNMP::Dispatcher::MESSAGE_PROCESSING;
158 162
337 kick_job; 341 kick_job;
338 342
339 1 343 1
340} 344}
341 345
342sub activate($) { 346sub loop($) {
343 while ($BUSY) { 347 while ($BUSY) {
344 $DONE = AE::cv; 348 $DONE = AE::cv;
345 $DONE->recv; 349 $DONE->recv;
346 undef $DONE; 350 undef $DONE;
347 } 351 }
348} 352}
349 353
354*activate = \&loop; # 5.x compatibility?
355*listen = \&loop; # 5.x compatibility?
356
350sub one_event($) { 357sub one_event($) {
351 # should not ever be used 358 # should not ever be used
352 AnyEvent->one_event; #d# todo 359 AnyEvent->one_event; #d# todo
353} 360}
354 361
355sub set_max_outstanding($) { 362sub set_max_outstanding($) {
356 $MAX_OUTSTANDING = $_[0]; 363 $MAX_OUTSTANDING = $_[0];
357 kick_job; 364 kick_job;
358} 365}
359 366
367# not provided yet:
368# schedule # apparently only used by Net::SNMP::Dispatcher itself
369# register # apparently only used by Net::SNMP::Dispatcher itself
370# deregister # apparently only used by Net::SNMP::Dispatcher itself
371# cancel # apparently only used by Net::SNMP::Dispatcher itself
372# return_response_pdu # apparently not used at all?
373# error # only used by Net::SNMP::Dispatcher itself?
374# debug # only used by Net::SNMP::Dispatcher itself?
375
360=head1 SEE ALSO 376=head1 SEE ALSO
361 377
362L<AnyEvent>, L<Net::SNMP>, L<Net::SNMP::XS>, L<Net::SNMP::EV>. 378L<AnyEvent>, L<Net::SNMP>, L<Net::SNMP::XS>, L<Net::SNMP::EV>.
363 379
364=head1 AUTHOR 380=head1 AUTHOR

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines