Skip to content

Commit

Permalink
code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
windycrypto committed Nov 26, 2023
1 parent a6cddbc commit 93fb843
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 10 deletions.
8 changes: 0 additions & 8 deletions relay/wshandlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,6 @@ import (

type WsMessageHandler func(*WsServer, SocketMessage)

var (
messageHandlers = map[MessageType]WsMessageHandler{
Pub: (*WsServer).pubMessage,
Sub: (*WsServer).subMessage,
Ping: (*WsServer).handlePingMessage,
}
)

func (ws *WsServer) pubMessage(message SocketMessage) {
topic := message.Topic
publisher := message.client
Expand Down
3 changes: 1 addition & 2 deletions relay/wsserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func NewWSServer(config *config.Config) *WsServer {
config: &config.WsServerConfig, // config

clients: make(map[*client]struct{}),
register: make(chan *client, 1024),
register: make(chan *client, 4096),
unregister: make(chan ClientUnregisterEvent, 4096),
pendingSessions: NewSortedPendingSessions(),

Expand Down Expand Up @@ -130,7 +130,6 @@ func (ws *WsServer) Run() {
log.Info("forward to subscriber", zap.Any("client", subscriber), zap.Any("message", message))
subscriber.send(message)
}

continue
}

Expand Down

0 comments on commit 93fb843

Please sign in to comment.