Thanks to the comment of a more experienced monk I have been made aware of a vast field of software engineering known as message queue.
After a bit of googling and a lot of stackoverflowing I went to have a look at Spread. Since it has a package on cpan I decided to install it (using someone else's better built code would save me a lot of debugging and rewriting). Then I got this :
Database was generated on Thu, 27 Aug 2015 07:53:25 GMT
Running install for module 'Spread'
Checksum for /root/.cpan/sources/authors/id/J/JE/JESUS/Spread-126.96.36.199
Scanning cache /root/.cpan/build for sizes
'YAML' not installed, will not store persistent state
Configuring J/JE/JESUS/Spread-188.8.131.52.tar.gz with Makefile.PL
Checking if your kit is complete...
Warning: -L../.. changed to -L/root/.cpan/build/Spread-184.108.40.206-VvdIsK
Warning (mostly harmless): No library found for -lspread
Generating a Unix-style Makefile
Writing Makefile for Spread
Writing MYMETA.yml and MYMETA.json
/usr/bin/perl Makefile.PL INSTALLDIRS=site -- OK
Running make for J/JE/JESUS/Spread-220.127.116.11.tar.gz
cp Spread.pm blib/lib/Spread.pm
AutoSplitting blib/lib/Spread.pm (blib/lib/auto/Spread)
Running Mkbootstrap for Spread ()
chmod 644 "Spread.bs"
"/usr/bin/perl" "/usr/share/perl/5.14/ExtUtils/xsubpp" -typemap "/usr
+/share/perl/5.14/ExtUtils/typemap" -typemap "typemap" Spread.xs > Sp
+read.xsc && mv Spread.xsc Spread.c
cc -c -I ../.. -I ../spread-src-3.17.0/ -D_REENTRANT -D_GNU_SOURCE -D
+DEBIAN -fstack-protector -fno-strict-aliasing -pipe -I/usr/local/incl
+ude -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g -DVERSION=\"3
+.17.4.4\" -DXS_VERSION=\"18.104.22.168\" -fPIC "-I/usr/lib/perl/5.14/CORE"
Spread.xs:15:16: fatal error: sp.h: No such file or directory
make: *** [Spread.o] Error 1
/usr/bin/make -- NOT OK
Failed during this command:
JESUS/Spread-22.214.171.124.tar.gz : make NO
I'm using debian wheezy, it seems other peoples have encountered the same problem but I had no luck finding an answer, so if anyone here used that package successfully I'd love to know how (sh|h)e did it.