There's more than one way to do things | |
PerlMonks |
Re: Sharing data "cache" between forked processesby cavac (Parson) |
on Nov 23, 2018 at 12:52 UTC ( [id://1226224]=note: print w/replies, xml ) | Need Help?? |
Really depends on your needs. But just to shamelessly plug my own stuff: Interprocess messaging with Net::Clacks Net::Clacks implements real time messaging as well as a memory-only cache. Basically, if you read a file, you could just store() it in Clacks as Base64. Structures could be encoded with JSON::XS + Base64. At least, that's how i'm doing it. If you want to handle the file loading/saving/deleting on the server side for some reason, it would be sort of trivial to implement. Just adding some flags to the OVERHEAD command handling in Net::Clacks::Server.pm should do the trick.
perl -e 'use MIME::Base64; print decode_base64("4pmsIE5ldmVyIGdvbm5hIGdpdmUgeW91IHVwCiAgTmV2ZXIgZ29ubmEgbGV0IHlvdSBkb3duLi4uIOKZqwo=");'
In Section
Seekers of Perl Wisdom
|
|