This is an automated email from the ASF dual-hosted git repository. alexstocks pushed a commit to branch feat/directNotify in repository https://gitbox.apache.org/repos/asf/dubbo-go.git
commit 7ac8a649f6a3af98d40ef8f53953df84b4a85a85 Author: LaurenceLiZhixin <[email protected]> AuthorDate: Sun Jan 17 15:53:55 2021 +0800 Fix: --- common/dubbo_dir_refresh.go | 26 -------------------------- common/rpc_service.go | 6 ++++++ remoting/getty/listener.go | 2 +- remoting/getty/pool.go | 2 +- remoting/getty/pool_test.go | 5 ++++- 5 files changed, 12 insertions(+), 29 deletions(-) diff --git a/common/dubbo_dir_refresh.go b/common/dubbo_dir_refresh.go deleted file mode 100644 index 294a53a..0000000 --- a/common/dubbo_dir_refresh.go +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package common - -import "sync" - -// DirMap is used by dubbo-getty, it can notify delete event to dubbo directory directly by getty session -// look up at: -// remoting/getty/listener.go -// registry/directory/directory.go -var DirMap sync.Map diff --git a/common/rpc_service.go b/common/rpc_service.go index 30d72c1..480651a 100644 --- a/common/rpc_service.go +++ b/common/rpc_service.go @@ -34,6 +34,12 @@ import ( "github.com/apache/dubbo-go/common/logger" ) +// DirMap is used by dubbo-getty, it can notify delete event to dubbo directory directly by getty session +// look up at: +// remoting/getty/listener.go +// registry/directory/directory.go +var DirMap sync.Map + // RPCService // rpc service interface type RPCService interface { diff --git a/remoting/getty/listener.go b/remoting/getty/listener.go index 238c211..477b372 100644 --- a/remoting/getty/listener.go +++ b/remoting/getty/listener.go @@ -19,7 +19,6 @@ package getty import ( "fmt" - "github.com/apache/dubbo-go/common" "sync" "sync/atomic" "time" @@ -32,6 +31,7 @@ import ( ) import ( + "github.com/apache/dubbo-go/common" "github.com/apache/dubbo-go/common/constant" "github.com/apache/dubbo-go/common/logger" "github.com/apache/dubbo-go/protocol/invocation" diff --git a/remoting/getty/pool.go b/remoting/getty/pool.go index 3775ec4..87a49e5 100644 --- a/remoting/getty/pool.go +++ b/remoting/getty/pool.go @@ -20,7 +20,6 @@ package getty import ( "crypto/tls" "fmt" - "github.com/apache/dubbo-go/common" "math/rand" "net" "sync" @@ -34,6 +33,7 @@ import ( ) import ( + "github.com/apache/dubbo-go/common" "github.com/apache/dubbo-go/common/logger" "github.com/apache/dubbo-go/config" ) diff --git a/remoting/getty/pool_test.go b/remoting/getty/pool_test.go index 6b888de..95ff9bf 100644 --- a/remoting/getty/pool_test.go +++ b/remoting/getty/pool_test.go @@ -18,7 +18,6 @@ package getty import ( - "github.com/apache/dubbo-go/common" "testing" "time" ) @@ -27,6 +26,10 @@ import ( "github.com/stretchr/testify/assert" ) +import ( + "github.com/apache/dubbo-go/common" +) + func TestGetConnFromPool(t *testing.T) { var rpcClient Client
