You can look at github.com/robaho/go-trader <http://github.com/robaho/go-trader>

See webserver.go and book.js

In this case, the server sends updates (market changes) to the subscribed 
clients unsolicited, but on an interval (so rapid changes on the server don’t 
flood the network).

I believe your solution would be similar - have a listener to the db that 
tracks “changes” in a map. A background go routine looks at the changes and 
sends them to websocket subscribers on an interval - grouping them for 
efficiency.

> On Oct 24, 2018, at 6:19 AM, sakthi apr <sakthilef...@gmail.com> wrote:
> 
> Hi,
> 
> I'm developing web socket in golang that checks the database changes like new 
> data insert. 
> 
> if the new record added in table user will get notified at client side.
> 
> Anyone have idea plz share with me.....
> 
> 
> Thanks
> 
> 
> -- 
> 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 golang-nuts+unsubscr...@googlegroups.com 
> <mailto:golang-nuts+unsubscr...@googlegroups.com>.
> For more options, visit https://groups.google.com/d/optout 
> <https://groups.google.com/d/optout>.

-- 
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 golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to