#1708895446
[ music | scene ]
I know what you want
To many music posts but nobody can stop me.
▄▄▄·▪ ▐ ▄ ▄▄▄ . ▐█ ▄███ •█▌▐█▀▄.▀· ██▀·▐█·▐█▐▐▌▐▀▀▪▄ ▐█▪·•▐█▌██▐█▌▐█▄▄▌ .▀ ▀▀▀▀▀ █▪ ▀▀▀
https://pine32.be - © pine32.be 2024
Welcome! - 58 total posts. [RSS]
A funny little cycle. [LATEST]
#1708895446
I know what you want
To many music posts but nobody can stop me.
#1708464707
Fire beat
#1707727407
SSE are cool.
This an example using the Echo framework in Golang. It sets up the connection, consumes a channel and sends that data to the user. It also exits the loop if the connection is broken, this is communicated via the request context.
func BuildingSSE(c echo.Context) error {
c.Response().Header().Set(echo.HeaderCacheControl, "no-cache")
c.Response().Header().Set(echo.HeaderConnection, "keep-alive")
c.Response().Header().Set(echo.HeaderContentType, "text/event-stream")
queue := queue.GetBuildQueue()
ctx := c.Request().Context()
for {
select {
case result := <-queue.BuildLogsChannel:
fmt.Fprint(c.Response(), buildSSE("message", result))
c.Response().Flush()
case <-ctx.Done():
return nil
}
}
}
func buildSSE(event, context string) string {
var result string
if len(event) != 0 {
result = result + "event: " + event + "\n"
}
if len(context) != 0 {
result = result + "data: " + context + "\n"
}
result = result + "\n"
return result
}
#1707727213
The beauty of my heart is not contagious!?
うつらない の わ こころ の うつくしさ
#1707657516
It’s a funny little cycle
#1707591969
Throwback
#1707084791
Custom embeds :D
With this feature done, mb is now ready for its first deployment.
Players never doubt
#1707084494
Vik Vaughn is a loser
Let me watch…