Re: [go-nuts] websocket implentation in golang

2018-10-24 Thread Skip Tavakkolian
Here's a sketch:

https://gist.github.com/9nut/11052587


On Wed, Oct 24, 2018 at 4:20 AM sakthi apr  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.
> For more options, visit 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.


Re: [go-nuts] websocket implentation in golang

2018-10-24 Thread robert engels
You can look at 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  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 
> .
> For more options, visit 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.


[go-nuts] websocket implentation in golang

2018-10-24 Thread sakthi apr
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.
For more options, visit https://groups.google.com/d/optout.