Skip to content

Commit

Permalink
optimize: split client.Init into rm.Init and tm.Init methods (apache#286
Browse files Browse the repository at this point in the history
)

optimize: nested loop retries (apache#261)
  • Loading branch information
jasondeng1997 authored Sep 25, 2022
1 parent 5e029a8 commit b753049
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 0 deletions.
27 changes: 27 additions & 0 deletions pkg/rm/init.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* 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 rm

// Init init seata client
func Init() {
initRmClient()
}

// InitRmClient init seata rm client
func initRmClient() {
}
44 changes: 44 additions & 0 deletions pkg/tm/init.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/*
* 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 tm

import (
"sync"

"github.com/seata/seata-go/pkg/remoting/getty"
)

var onceInitTmClient sync.Once

// InitTmClient init seata tm client
func InitTmClient() {
onceInitTmClient.Do(func() {
initConfig()
initRemoting()
})
}

// initConfig init config processor
func initConfig() {
// todo implement
}

// initRemoting init rpc client
func initRemoting() {
getty.InitRpcClient()
}

0 comments on commit b753049

Please sign in to comment.