// Publish sends a message to the given topic. It accepts any serializable type as message.
Publish sends a message to the given topic. It accepts any serializable type as message.
// Publish sends a message to the given topic . It accepts any serializable type as message .
func (dt *DTopic) Publish(msg interface{}) error {
	value, err := dt.serializer.Marshal(msg)
	if err != nil {
		return err
	}
	req := protocol.NewDTopicMessage(protocol.OpDTopicPublish)
	req.SetDTopic(dt.name)
	req.SetValue(value)
	resp, err := dt.request(req)
	if err != nil {
		return err
	}
	return checkStatusCode(resp)
}
func ( dt * DTopic ) Publish ( msg interface { } ) error { value , err := dt . serializer . Marshal ( msg ) if err != nil { return err } req := protocol . NewDTopicMessage ( protocol . OpDTopicPublish ) req . SetDTopic ( dt . name ) req . SetValue ( value ) resp , err := dt . request ( req ) if err != nil { return err } return checkStatusCode ( resp ) }
Publish sends a message to the given topic.
Publish sends a message to the given topic .