You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@inlong.apache.org by GitBox <gi...@apache.org> on 2021/05/01 02:11:26 UTC

[GitHub] [incubator-inlong] TszKitLo40 commented on a change in pull request #464: [INLONG-600]Multiplexed connection pool for Go sdk

TszKitLo40 commented on a change in pull request #464:
URL: https://github.com/apache/incubator-inlong/pull/464#discussion_r624365229



##########
File path: tubemq-client-twins/tubemq-client-go/pool/multiplexed.go
##########
@@ -0,0 +1,403 @@
+/**
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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 pool
+
+import (
+	"context"
+	"crypto/tls"
+	"crypto/x509"
+	"errors"
+	"io/ioutil"
+	"net"
+	"sync"
+	"time"
+
+	"github.com/apache/incubator-inlong/tubemq-client-twins/tubemq-client-go/codec"
+)
+
+var DefaultMultiplexedPool = New()
+
+var (
+	// ErrConnClosed indicates that the connection is closed
+	ErrConnClosed = errors.New("connection is closed")
+	// ErrChanClose indicates the recv chan is closed
+	ErrChanClose = errors.New("unexpected recv chan close")
+	// ErrWriteBufferDone indicates write buffer done
+	ErrWriteBufferDone = errors.New("write buffer done")
+	// ErrAssertConnectionFail indicates connection assertion error
+	ErrAssertConnectionFail = errors.New("assert connection slice fail")
+)
+
+const (
+	Initial int = iota
+	Connected
+	Closing
+	Closed
+)
+
+var queueSize = 10000
+
+func New() *Multiplexed {

Review comment:
       I have changed the file and package name to multiplexing.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org