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
Inside the Run() method, I'm setting up a connection with DialContext(s.context, url, nil) and diving into an endless loop that listens for signals. My goal here is to catch SIGINT and SIGTERM so I can neatly wrap up the connection and close the app on a good note. Here's what the service code looks like:
When I give it a go and trigger a SIGTERM, the app just keeps on running. It looks like conn.ReadMessage() is holding up the main go-routine while it waits for new bytes from the websocket channel. I might be missing something here, but this seems a bit off to me. Is this how it's supposed to work? What's the best way to deal with termination signals with this library?
Thanks a bunch for your insights!
Expected Behavior
No response
Steps To Reproduce
No response
Anything else?
No response
The text was updated successfully, but these errors were encountered:
Yep, I fixed it yesterday already. I made a goroutine for reading messages. The main goroutine is awaiting signals in for-cycle in the end of my Connect func:
Is there an existing issue for this?
Current Behavior
Hey!
I've got a
main.go
file where I'm playing around with this code snippet:Inside the
Run()
method, I'm setting up a connection withDialContext(s.context, url, nil)
and diving into an endless loop that listens for signals. My goal here is to catchSIGINT
andSIGTERM
so I can neatly wrap up the connection and close the app on a good note. Here's what the service code looks like:When I give it a go and trigger a
SIGTERM
, the app just keeps on running. It looks likeconn.ReadMessage()
is holding up the main go-routine while it waits for new bytes from the websocket channel. I might be missing something here, but this seems a bit off to me. Is this how it's supposed to work? What's the best way to deal with termination signals with this library?Thanks a bunch for your insights!
Expected Behavior
No response
Steps To Reproduce
No response
Anything else?
No response
The text was updated successfully, but these errors were encountered: