func (s *Socket) Run(ctx context.Context, wg *sync.WaitGroup, in <-chan message.Message, out chan<- message.Message) {
	pingTicker := time.NewTicker(s.PingPeriod)
	httpPingTicker := time.NewTicker(s.HTTPPingPeriod)
	wg.Add(2)
	go s.readMessagesSync(ctx, wg, out)
	go s.writeMessagesSync(ctx, wg, in, pingTicker, httpPingTicker)
}
// Run writes messages from the connection to the shared "out" channel.
// Run writes messages received from the "in" channel to the connection,
// The run stays active even if it errors out.  The only way to stop it is by closing the 'in' channel.
// If the connection has an error, the socket will send a socketClose message on the out channel, but will still consume and ignore messages from the in channel until it is closed this prevents a channel blockage.
Run writes messages from the connection to the shared "out" channel.
Run writes messages received from the "in" channel to the connection,
The run stays active even if it errors out.  The only way to stop it is by closing the 'in' channel.
If the connection has an error, the socket will send a socketClose message on the out channel, but will still consume and ignore messages from the in channel until it is closed this prevents a channel blockage.
// Run writes messages from the connection to the shared " out " channel . // Run writes messages received from the " in " channel to the connection // The run stays active even if it errors out . The only way to stop it is by closing the ' in ' channel . // If the connection has an error the socket will send a socketClose message on the out channel but will still consume and ignore messages from the in channel until it is closed this prevents a channel blockage .
func (s *Socket) Run(ctx context.Context, wg *sync.WaitGroup, in <-chan message.Message, out chan<- message.Message) {
	pingTicker := time.NewTicker(s.PingPeriod)
	httpPingTicker := time.NewTicker(s.HTTPPingPeriod)
	wg.Add(2)
	go s.readMessagesSync(ctx, wg, out)
	go s.writeMessagesSync(ctx, wg, in, pingTicker, httpPingTicker)
}
func ( s * Socket ) Run ( ctx context . Context , wg * sync . WaitGroup , in <- chan message . Message , out chan <- message . Message ) { pingTicker := time . NewTicker ( s . PingPeriod ) httpPingTicker := time . NewTicker ( s . HTTPPingPeriod ) wg . Add ( 2 ) go s . readMessagesSync ( ctx , wg , out ) go s . writeMessagesSync ( ctx , wg , in , pingTicker , httpPingTicker ) }
Run writes messages from the connection to the shared "out" channel.
Run writes messages from the connection to the shared " out " channel .