Live: update centrifuge and the ChannelHandler api (#28843)
This commit is contained in:
+4
-8
@@ -7,15 +7,11 @@ type ChannelPublisher func(channel string, data []byte) error
|
||||
|
||||
// ChannelHandler defines the core channel behavior
|
||||
type ChannelHandler interface {
|
||||
// This is called fast and often -- it must be synchrnozed
|
||||
GetChannelOptions(id string) centrifuge.ChannelOptions
|
||||
// OnSubscribe is called when a client wants to subscribe to a channel
|
||||
OnSubscribe(c *centrifuge.Client, e centrifuge.SubscribeEvent) (centrifuge.SubscribeReply, error)
|
||||
|
||||
// Called when a client wants to subscribe to a channel
|
||||
OnSubscribe(c *centrifuge.Client, e centrifuge.SubscribeEvent) error
|
||||
|
||||
// AllowBroadcast is called when a client writes a message to the channel websocket.
|
||||
// Returning an error will cancel the broadcast.
|
||||
AllowBroadcast(c *centrifuge.Client, e centrifuge.PublishEvent) error
|
||||
// OnPublish is called when a client writes a message to the channel websocket.
|
||||
OnPublish(c *centrifuge.Client, e centrifuge.PublishEvent) (centrifuge.PublishReply, error)
|
||||
}
|
||||
|
||||
// ChannelHandlerFactory should be implemented by all core features.
|
||||
|
||||
Reference in New Issue
Block a user