App-Diskd
view release on metacpan or search on metacpan
lib/App/Diskd.pm view on Meta::CPAN
=head1 MOTIVATION/GENESIS
The reason for writing this program was to explore three key areas:
=over
=item 1. Multicast (and peer-to-peer) networking
=item 2. Daemons and method of communicating with them
=item 3. Using POE to develop a non-trivial program with a focus on asynchronous, event-based operation
=back
As I write this, the size of the program is significantly less than
1,000 lines (not including this documentation), while still managing
to implement a reasonably complex network daemon. In all, it took
about an evening's work to code and eliminate most of the major
bugs. The reason for both the small size and quick development time
can be attributed to the combination of Perl and POE. Despite this
being my first time writing any program using POE, the speed of
lib/App/Diskd.pm view on Meta::CPAN
it is basically the glue that holds all the POE sessions together and
gives them meaning.
The current implementation simply keeps all the data in memory, though
it would be simple enough to either:
=over
=item * provide a routine to be called at program startup to read in saved data from a file or other backing storage (along with a complementary routine to save the data when the program is shutting down); or
=item * interface with a database to act as a permanent storage medium (POE provides mechanisms for doing this asynchronously, which might be appropriate here)
=back
Internally, this class also uses YAML to pack and unpack (serialise
and deserialise) the stored data. This is used by the MulticastServer
class to safely transmit and receive data within the UDP packets. It
could also be used to load/save the data to local storage between
program runs (ie, provide persistence of data).
( run in 0.978 second using v1.01-cache-2.11-cpan-0d8aa00de5b )