Sending messages without a goroutine
This commit is contained in:
+1
-5
@@ -39,9 +39,5 @@ func newConnection(socketID string, s socket) *connection {
|
|||||||
|
|
||||||
// Publish the message to websocket atached to this client
|
// Publish the message to websocket atached to this client
|
||||||
func (conn *connection) Publish(m interface{}) {
|
func (conn *connection) Publish(m interface{}) {
|
||||||
go func() {
|
conn.Socket.WriteJSON(m)
|
||||||
if err := conn.Socket.WriteJSON(m); err != nil {
|
|
||||||
log.Errorf("Error publishing message to connection %+v, %s", conn, err)
|
|
||||||
}
|
|
||||||
}()
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user