chore: cleaning unused mutex
This commit is contained in:
@@ -8,6 +8,7 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
custom_rwmutex "git.neurocipta.com/rogerferdinan/custom-rwmutex"
|
||||
"git.neurocipta.com/rogerferdinan/safe-web-socket/internal"
|
||||
"github.com/gorilla/websocket"
|
||||
)
|
||||
@@ -74,7 +75,7 @@ func (b *SafeWebsocketClientBuilder) Build() (*SafeWebsocketClient, error) {
|
||||
ctx: ctx,
|
||||
cancel: cancel,
|
||||
dataChannel: make(chan []byte, 1),
|
||||
mu: internal.NewCustomRwMutex(),
|
||||
mu: custom_rwmutex.NewCustomRwMutex(),
|
||||
reconnectCh: make(chan struct{}, 1),
|
||||
isConnected: false,
|
||||
}
|
||||
@@ -94,7 +95,7 @@ type SafeWebsocketClient struct {
|
||||
path *string
|
||||
rawQuery *string
|
||||
dataChannel chan []byte
|
||||
mu *internal.CustomRwMutex
|
||||
mu *custom_rwmutex.CustomRwMutex
|
||||
conn *websocket.Conn
|
||||
ctx context.Context
|
||||
cancel context.CancelFunc
|
||||
@@ -181,7 +182,7 @@ func (wsClient *SafeWebsocketClient) startReceiveHandler() {
|
||||
log.Println("Reconnect handler stopped")
|
||||
return
|
||||
default:
|
||||
if err := wsClient.mu.WriteHandler(func() error {
|
||||
if err := wsClient.mu.ReadHandler(func() error {
|
||||
conn := wsClient.conn
|
||||
|
||||
if conn == nil {
|
||||
|
||||
Reference in New Issue
Block a user