Net::SIP::Dispatcher::AnyEvent - AnyEvent dispatcher for Net::SIP
version 0.001
This module allows Net::SIP to work with AnyEvent as the event loop, instead of its own. This means you can combine them.
While this is the implementation itself, you probably want to use AnyEvent::SIP instead. You definitely want to read the documentation there instead of here. Go ahead, click the link. :)
The rest only documents how the loop implementation works. If you use this directly, the only method you care about is loop.
loop
Net::SIP requires dispatchers (event loops) to check their stopvars (condition variables) every single iteration of the loop. In my opinion, it's a wasteful and heavy operation. When it comes to loops like EV, they run a lot of cycles, and it's probably not very effecient. Take that under advisement.
I would happily accept any suggestions on how to improve this. Meanwhile, we're using AnyEvent::AggressiveIdle.
These attributes have no accessors, they are saved as internal keys.
Hold the AnyEvent::AggressiveIdle object that checks stopvars.
Condition variables to be checked for stopping the loop.
Main condition variable allowing for looping.
All the watched file descriptors.
The object constructor. It creates a default CondVar in _cv hash key, and sets an aggressive idle CondVar in the _idle hash key, which checks the stopvars every loop cycle.
_cv
_idle
Add a file descriptor to watch input for, and a callback to run when it's ready to be read.
Delete the watched file descriptor.
Create a timer to run a callback at a certain point in time. If the time is considerably far (3,600 * 24 * 365 and up), it's a specific point in time. Otherwise, it's a number of seconds from now.
The repeat option is an optional interval for the timer.
repeat
Provide the event loop time.
Run the event loop and wait for all events to finish (whether by timeout or stopvars becoming true).
Sawyer X <xsawyerx@cpan.org>
This software is copyright (c) 2013 by Sawyer X.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install AnyEvent::SIP, copy and paste the appropriate command in to your terminal.
cpanm
cpanm AnyEvent::SIP
CPAN shell
perl -MCPAN -e shell install AnyEvent::SIP
For more information on module installation, please visit the detailed CPAN module installation guide.