diff --git a/topic.go b/topic.go index e2e7b8a..783498a 100644 --- a/topic.go +++ b/topic.go @@ -241,7 +241,7 @@ func (t *Topic) Publish(ctx context.Context, data []byte, opts ...PubOpt) error t.p.disc.Bootstrap(ctx, t.topic, pub.ready) } - return t.p.val.Publish(&Message{m, t.p.host.ID(), nil}) + return t.p.val.PushLocal(&Message{m, t.p.host.ID(), nil}) } // WithReadiness returns a publishing option for only publishing when the router is ready. diff --git a/validation.go b/validation.go index 0a15262..d4ad27d 100644 --- a/validation.go +++ b/validation.go @@ -210,9 +210,10 @@ func (v *validation) RemoveValidator(req *rmValReq) { } } -// Publish synchronously accepts a locally published message, performs applicable -// validations and pushes the message for propagate by the pubsub system -func (v *validation) Publish(msg *Message) error { +// PushLocal synchronously pushes a locally published message and performs applicable +// validations. +// Returns an error if validation fails +func (v *validation) PushLocal(msg *Message) error { v.p.tracer.PublishMessage(msg) err := v.p.checkSignature(msg)