+SSE send

This commit is contained in:
Miki 2024-01-05 13:31:33 +00:00
parent 55dc87af43
commit c05c44a13e
20 changed files with 217 additions and 198 deletions

1
sse/be/.gitignore vendored
View file

@ -1 +1,2 @@
static
.vscode

BIN
sse/be/be

Binary file not shown.

View file

@ -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
}
}
}

View file

@ -1 +1 @@
{"version":"1703075413040"}
{"version":"1704454074172"}

Binary file not shown.

Binary file not shown.

View file

@ -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.

View file

@ -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.