Adding an optional argument "validator"

validator must, if set, be a function that takes a client
as first argument and returns a boolean, true or false,
if the given publish request should be sent to that
client. The knowledge of the package in question should be
avaiable in the defining scope of the validator and will
not be passed to it when called.
adding documentation and renamed function