|
Do you really care about the newlines or can you just put the body into a json.Decoder directly and keep asking it to decode until .More() or w/e is false?
|
# ¿ Aug 31, 2018 03:40 |
|
|
# ¿ May 11, 2024 17:33 |
|
Hey, does anyone know if it's safe to try to close the same socket multiple times and/or from multiple goroutines, without risk to close an unrelated socket that reused the first socket's file descriptor after the first close? I'm trying to untangle some messy websocket setup with separate reader/writer goroutines that currently leaks sockets unless we do the graceful websocket shutdown, and I'm trying to figure out if I can just try to close in some codepath that always gets taken or if I need to track across goroutines whether the graceful shutdown has taken place.
|
# ¿ Feb 4, 2019 13:40 |
|
Thanks! I'd followed a websocket Close call with delve until I got to increfAndClose, where I figured it looks spooky enough that I wouldn't be confident in my own understand of the synchronization there either way.
|
# ¿ Feb 5, 2019 10:58 |
|
Does the ALB not reuse connections? Maybe I'm naive here but I'd have expected that session spinup gets amortized away immediately.
|
# ¿ Dec 15, 2019 11:06 |
|
Yeah, if you use interface{} you have to cast to some other type (probably a nested map[string]interface{}) all the time. Writing down struct definitions is annoying if you have many/complicated json responses and we also mostly deal with that by having both service and caller share autogenerated protobuf structs. But I'd definitely prefer writing a struct definition over a bunch of casting, particularly because it also documents the overall shape of the expected response locally.
|
# ¿ Jul 9, 2020 23:08 |