rename validation.Publish to PushLocal

This commit is contained in:
vyzo 2021-03-26 10:41:42 +02:00
parent 32b8d8958e
commit 175d43f4e7
2 changed files with 5 additions and 4 deletions

View File

@ -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.

View File

@ -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)