Hello,
My team is developing a cloud-based data processing application, and a
large bulk of the application's job is doing network calls to other
services.
Go's goroutines and channel-based communication are an excellent fit, but
in order for the application to be able to properly shut down,
simple construct of sending to a channel `myChan <- value` needs to
actually be something like:
```
select {
case myChan <- value:
case <-ctx.Done():
return ctx.Err()
}
```
As you see, a simple one line construct needs to be replaced with a select
on context.Done EVERYWHERE.
My two gripes with this situation are:
1) It's more code and "clutter" which makes code less clear
2) It's easy to forget to do a select on context.Done, and then an
application is unable to shut down.
Am I doing something wrong? Does someone relate with me?
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/golang-nuts/b168ad30-22e6-4205-8cfd-ddc9103b00a2o%40googlegroups.com.