sub dispatch { my($self, $code) = (shift, shift); push @{ $self->{running} }, $code; my $result = eval { &$code($self, @_) }; pop @{ $self->{running} }; die if $@; return $result; }