AnyEvent-ZeroMQ

 view release on metacpan or  search on metacpan

lib/AnyEvent/ZeroMQ/Types.pm  view on Meta::CPAN

        return 0;
    }
    return 0;

}, message { 'An endpoint must be in the form "<transport>://<address>"' };

subtype Endpoints, as ArrayRef[Endpoint], message {
    'Each endpoint must be in the form "<transport>://<address>"';
};

sub fixup_endpoint() {
    s{(^[/])/$}{$1}g;
}

coerce Endpoint, from Str, via { fixup_endpoint };

coerce Endpoints, from ArrayRef[Str], via {
    my @array = @$_;
    fixup_endpoint for @array;
    $_ = [@array];
};



( run in 0.637 second using v1.01-cache-2.11-cpan-65fba6d93b7 )