The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.
#!/usr/bin/env perl

use strict;use warnings;
use IPC::Transit;
use Data::Dumper;
use Getopt::Std;

$| = 1;

my $opts = {};
getopt('Pd', $opts);
my $debug = 0;
if($opts->{P}) {
    $IPC::Transit::config_dir = $opts->{P};
    print "Using alternative Transit config dir: $IPC::Transit::config_dir\n";
}
if($opts->{d}) {
    $debug = $opts->{d};
    print "Debug level $debug set\n";
}

while(1) {
    eval {
        #The special logic that triggers here is in IPC::Transit::post_remote
        my $ret = IPC::Transit::receive(qname => 'transitd');
        print Dumper $ret;
    };
    print "error: $@\n" if $@;
}