Thank you a lot, Diego!
I decided to implement this exatctly as you said (one goroutine for list of
pairs user:location), and this is much more correct.
понедельник, 20 февраля 2017 г., 4:27:10 UTC+3 пользователь Diego Medina
написал:
>
> Hi,
>
> Instead of starting them from an http handler,
Hi,
Instead of starting them from an http handler, I would store in the
database the locations and their users. Then, from main() I would start
just one go routine that will check the db for any pending location that
needs to be fetched, if found, then go do work, sleep for x seconds, then
check t