NAME

Net::Object::Peer::Subscriptions - A collection of Net::Object::Peer::Subscriptions

VERSION

version 0.06

DESCRIPTION

A Net::Object::Peer::Subscriptions object manages a collection of Net::Object::Peer::Subscriptions objects.

METHODS

list

@subs = $subs->list;

Returns a list of hashrefs containing attributes for all subscriptions.

nelem

$nelem = $subs->nelem;

return the number of elements in the list of subscriptions.

add

$subs->add( %attr );

Add a subscription. See Net::Object::Peer::Subscription for the supported attributes.

find

my @subs = $subs->find( $coderef | %spec );

Returns a list of hashrefs containing attributes for subscriptions which match the passed arguments.

A single argument must be a coderef; it will be invoked with a Net::Peer::Subscription object as an argument. It should return true if it matches, false otherwise.

If a hash is passed, its values are compared to the attributes of subscriptions in the list.

remove

@hashrefs = $subs->remove( $coderef | %spec );

Unsubscribe the matching subscriptions, remove them from the list of subscriptions, and return hashrefs containing the subscriptions' event names and peers.

AUTHOR

Diab Jerius <djerius@cpan.org>

COPYRIGHT AND LICENSE

This software is Copyright (c) 2016 by Smithsonian Astrophysical Observatory.

This is free software, licensed under:

The GNU General Public License, Version 3, June 2007