You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 24, 2023. It is now read-only.
I have this specific scenario where my application spawns n chat channels, (think of it like chat rooms with many listening and only one speaking) with n users listening each channel.
Only a central authority can broadcast to those channels (e.g. my app), and I plan to fire broadcasting in other parts of my application which are in other files, so I have no more access to the c context variable directly.
Is it possible to actually fire c.WriteMessage from other parts of the project?
Relevant code snippet:
app.Get("/ws/channels/:id", websocket.New(func(c*websocket.Conn) {
id:=c.Params("id")
// How can I save ReadMessage() and WriteMessage() instances// in such a manner that I can call them from any other place in// my Fiber application?//// But also have the intelligence of only broadcasting to those// who matches the same id param of my broadcast? readMessageInstance:=c.ReadMessagewriteMessageInstance:=c.WriteMessage
}))
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I have this specific scenario where my application spawns n chat channels, (think of it like chat rooms with many listening and only one speaking) with n users listening each channel.
Only a central authority can broadcast to those channels (e.g. my app), and I plan to fire broadcasting in other parts of my application which are in other files, so I have no more access to the
c
context variable directly.Is it possible to actually fire
c.WriteMessage
from other parts of the project?Relevant code snippet:
The text was updated successfully, but these errors were encountered: