package System::Introspector::Gatherer::Bridge;
use Object::Remote;
use Object::Remote::Future;
use Moo;

has remote_spec => (is => 'ro', required => 1);
has remote_class => (is => 'ro', required => 1);
has remote_args => (is => 'ro', required => 1);
has remote => (is => 'lazy');

sub _build_remote {
    my ($self) = @_;
    return $self->remote_class
        ->new::on($self->remote_spec, $self->remote_args);
}

sub gather { (shift)->remote->gather(@_) }

1;
