| 1 | package System::Introspector::Gatherer::Bridge; | ||
| 2 | use Object::Remote; | ||
| 3 | use Object::Remote::Future; | ||
| 4 | use Moo; | ||
| 5 | |||
| 6 | has remote_spec => (is => 'ro', required => 1); | ||
| 7 | has remote_class => (is => 'ro', required => 1); | ||
| 8 | has remote_args => (is => 'ro', required => 1); | ||
| 9 | has remote => (is => 'lazy'); | ||
| 10 | |||
| 11 | sub _build_remote { | ||
| 12 | my ($self) = @_; | ||
| 13 | return $self->remote_class | ||
| 14 | ->new::on($self->remote_spec, $self->remote_args); | ||
| 15 | } | ||
| 16 | |||
| 17 | sub gather { (shift)->remote->gather(@_) } | ||
| 18 | |||
| 19 | 1; | ||
| 20 | |||
| 21 | __END__ |