Live: improve broadcast semantics and avoid double posting (#28765)

This commit is contained in:
Ryan McKinley
2020-11-03 09:11:23 -08:00
committed by GitHub
parent 5a11abe954
commit b7a8416e02
8 changed files with 28 additions and 52 deletions
+3 -3
View File
@@ -80,9 +80,9 @@ func (r *logQueryRunner) OnSubscribe(c *centrifuge.Client, e centrifuge.Subscrib
return nil
}
// OnPublish is called when an event is received from the websocket.
func (r *logQueryRunner) OnPublish(c *centrifuge.Client, e centrifuge.PublishEvent) ([]byte, error) {
return nil, fmt.Errorf("can not publish")
// AllowBroadcast checks if a message from the websocket can be broadcast on this channel
func (r *logQueryRunner) AllowBroadcast(c *centrifuge.Client, e centrifuge.PublishEvent) error {
return fmt.Errorf("can not publish")
}
func (r *logQueryRunner) publishResults(channelName string) error {