I'm working on a project which focuses on simple HTTP-related actions (to get my feet wet really). I'm using the
net/http package, which I thought was very convenient for almost all requirements except that it seems a
http.Server gives instructions to
http.Client if and only if the client has established a connection.
I have learnt that
- I can use
x/net/websocketto solve this problem.
- I can choose to use some long polling technique(I guess).
- I have also considered spawning a routine by my client to connect to the server repeatedly to simulate the notifications, like every 200 milliseconds.
I have implemented most of the functions using
net/http, so I'm not sure if I should really move to
My question is: what is the common paradigm that Go engineers will use in this situation? Which is the most doable idea, or is there a better solution?