+SSE send
This commit is contained in:
parent
55dc87af43
commit
c05c44a13e
20 changed files with 217 additions and 198 deletions
|
@ -5,6 +5,7 @@ import (
|
|||
"fmt"
|
||||
"io"
|
||||
"log"
|
||||
"slices"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
|
@ -124,7 +125,9 @@ func (e *Event) Send(msg Message) {
|
|||
e.Id++
|
||||
msg.Id = strconv.Itoa(e.Id)
|
||||
for _, client := range e.Clients {
|
||||
client.Chan <- msg
|
||||
if slices.Contains(client.Events, msg.Event) || slices.Contains(client.Events, "*") {
|
||||
client.Chan <- msg
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue