Merge pull request '[🚀] sse' (#11) from dev into main

Reviewed-on: #11
This commit is contained in:
bvbej 2024-09-07 13:41:59 +08:00
commit 75fd09620c

View File

@ -14,7 +14,7 @@ var _ Server = (*event)(nil)
type Server interface {
GinHandle(ctx *gin.Context, user any)
HandlerFunc() mux.HandlerFunc
Push(user, name, msg string) bool
Push(user any, name, msg string) bool
Broadcast(name, msg string)
}
@ -104,7 +104,7 @@ func (stream *event) HandlerFunc() mux.HandlerFunc {
}
}
func (stream *event) Push(user, name, msg string) bool {
func (stream *event) Push(user any, name, msg string) bool {
value, ok := stream.SessionList.Load(user)
if ok {
val := value.(chan msgChan)