+SSE send
This commit is contained in:
parent
55dc87af43
commit
c05c44a13e
20 changed files with 217 additions and 198 deletions
1
sse/be/.gitignore
vendored
1
sse/be/.gitignore
vendored
|
@ -1 +1,2 @@
|
|||
static
|
||||
.vscode
|
||||
|
|
BIN
sse/be/be
BIN
sse/be/be
Binary file not shown.
|
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1 +1 @@
|
|||
{"version":"1703075413040"}
|
||||
{"version":"1704454074172"}
|
Binary file not shown.
Binary file not shown.
|
@ -5,17 +5,17 @@
|
|||
<link rel="icon" href="/favicon.png" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
|
||||
<link rel="modulepreload" href="/_app/immutable/entry/start.23JL8z_X.js">
|
||||
<link rel="modulepreload" href="/_app/immutable/entry/start.WxGgh-q9.js">
|
||||
<link rel="modulepreload" href="/_app/immutable/chunks/scheduler.k-kUyWhY.js">
|
||||
<link rel="modulepreload" href="/_app/immutable/chunks/singletons.lz88bAPY.js">
|
||||
<link rel="modulepreload" href="/_app/immutable/entry/app.kMziKss5.js">
|
||||
<link rel="modulepreload" href="/_app/immutable/chunks/singletons.gs6RVdA8.js">
|
||||
<link rel="modulepreload" href="/_app/immutable/entry/app.Now5kMwx.js">
|
||||
<link rel="modulepreload" href="/_app/immutable/chunks/index.PctGSwCt.js">
|
||||
</head>
|
||||
<body data-sveltekit-preload-data="hover">
|
||||
<div style="display: contents">
|
||||
<script>
|
||||
{
|
||||
__sveltekit_1eon4i8 = {
|
||||
__sveltekit_1houvg5 = {
|
||||
base: "",
|
||||
env: null
|
||||
};
|
||||
|
@ -23,8 +23,8 @@
|
|||
const element = document.currentScript.parentElement;
|
||||
|
||||
Promise.all([
|
||||
import("/_app/immutable/entry/start.23JL8z_X.js"),
|
||||
import("/_app/immutable/entry/app.kMziKss5.js")
|
||||
import("/_app/immutable/entry/start.WxGgh-q9.js"),
|
||||
import("/_app/immutable/entry/app.Now5kMwx.js")
|
||||
]).then(([kit, app]) => {
|
||||
kit.start(app, element);
|
||||
});
|
||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -5,17 +5,17 @@
|
|||
<link rel="icon" href="../favicon.png" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
|
||||
<link rel="modulepreload" href="../_app/immutable/entry/start.23JL8z_X.js">
|
||||
<link rel="modulepreload" href="../_app/immutable/entry/start.WxGgh-q9.js">
|
||||
<link rel="modulepreload" href="../_app/immutable/chunks/scheduler.k-kUyWhY.js">
|
||||
<link rel="modulepreload" href="../_app/immutable/chunks/singletons.lz88bAPY.js">
|
||||
<link rel="modulepreload" href="../_app/immutable/entry/app.kMziKss5.js">
|
||||
<link rel="modulepreload" href="../_app/immutable/chunks/singletons.gs6RVdA8.js">
|
||||
<link rel="modulepreload" href="../_app/immutable/entry/app.Now5kMwx.js">
|
||||
<link rel="modulepreload" href="../_app/immutable/chunks/index.PctGSwCt.js">
|
||||
</head>
|
||||
<body data-sveltekit-preload-data="hover">
|
||||
<div style="display: contents">
|
||||
<script>
|
||||
{
|
||||
__sveltekit_1eon4i8 = {
|
||||
__sveltekit_1houvg5 = {
|
||||
base: new URL("..", location).pathname.slice(0, -1),
|
||||
env: null
|
||||
};
|
||||
|
@ -23,8 +23,8 @@
|
|||
const element = document.currentScript.parentElement;
|
||||
|
||||
Promise.all([
|
||||
import("../_app/immutable/entry/start.23JL8z_X.js"),
|
||||
import("../_app/immutable/entry/app.kMziKss5.js")
|
||||
import("../_app/immutable/entry/start.WxGgh-q9.js"),
|
||||
import("../_app/immutable/entry/app.Now5kMwx.js")
|
||||
]).then(([kit, app]) => {
|
||||
kit.start(app, element);
|
||||
});
|
||||
|
|
Binary file not shown.
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue