Compare commits

..

2 Commits

Author SHA1 Message Date
0c9b20d47f Merge pull request '[🚀] ClientCount' (#16) from dev into main
Reviewed-on: #16
2024-09-07 17:13:43 +08:00
1e33734ab1 [🚀] ClientCount 2024-09-07 17:13:43 +08:00

View File

@ -17,6 +17,7 @@ type Server interface {
GinHandlerFunc(auth func(c *gin.Context) (string, error)) gin.HandlerFunc
Push(user any, name, msg string) bool
Broadcast(name, msg string)
ClientCount() int32
}
type clientChan struct {
@ -157,3 +158,7 @@ func (stream *event) Broadcast(name, msg string) {
return true
})
}
func (stream *event) ClientCount() int32 {
return stream.Count.Load()
}