+sub sig_usr1 {
+ my $kernel = $_[KERNEL];
+ $kernel->yield( 'refresh' );
+}
+
+sub sig_usr2 {
+ my $heap = $_[HEAP];
+
+ open COMMANDS, 'commands';
+ my @commands = split /\W+/, do { local $/; <COMMANDS> };
+ close COMMANDS;
+
+ say "Loading commands from: @commands";
+ my $disp = new NDIRC::Dispatcher;
+ $disp->load(@commands);
+
+ open CHANNELS, 'channels';
+ while (<CHANNELS>){
+ my ($chan, @types) = split /\s+/;
+ say "$chan - @types";
+ $disp->add_channel($chan,\@types);
+ }
+ close CHANNELS;
+
+ $heap->{disp} = $disp;
+}
+