Skip to content

Commit

Permalink
route delete bind (#100)
Browse files Browse the repository at this point in the history
Co-authored-by: van <no-replay@xgmail.com>
  • Loading branch information
cute-angelia and van authored May 6, 2023
1 parent 7ac0ab2 commit 1698d2e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions session/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@ func (r *Router) Bind(service, address string) {
r.routes.Store(service, address)
}

// Delete route delete bind for
// 1. some son-service restart, sadly it's not auto bind new son-service
// 2. some game have match to some service, delete bind and match customer service
func (r *Router) Delete(service string) {
r.routes.Delete(service)
}

// Find finds the address corresponding a remote service
func (r *Router) Find(service string) (string, bool) {
v, found := r.routes.Load(service)
Expand Down

0 comments on commit 1698d2e

Please sign in to comment.