You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+15-15Lines changed: 15 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
# grpc-connection-library
2
2
grpc-connection-library is a library that supports the gRPC client-server connection interface for the developers to use as a gRPC middleware in the application. The library is written in Golang with a concurrency pipeline design pattern to synchronize the gRPC connection pool system.
3
3
4
-
# Features
4
+
##Features
5
5
- The gRPC connection flow among server/client synchronized using the Ping/Pong services.
6
6
- gRPC connection library supports connection pool reuse the gRPC client connection instance.
7
7
- Concurrency Pipeline design pattern synchronizes the data flow among several stages while creating the connection pool.
@@ -10,16 +10,16 @@ grpc-connection-library is a library that supports the gRPC client-server connec
10
10
- The grpc-retry policy helps to retry the failure of gRPC connections with backoff strategy.
11
11
- The <ahref="https://pkg.go.dev/google.golang.org/grpc/grpclog">grpclog</a> will show the internal connection lifecycle that will be useful to debug the connection flow.
12
12
13
-
# Installation
13
+
##Installation
14
14
15
15
`go get github.com/Deeptiman/go-connection-library`
16
16
17
-
# Demo
17
+
##Demo
18
18
19
19
20
-
# Go Docs
20
+
##Go Docs
21
21
22
-
# Example
22
+
##Example
23
23
<b>Client</b>:
24
24
25
25
```````````````````````````````go
@@ -66,7 +66,7 @@ func main() {
66
66
}
67
67
```````````````````````````````
68
68
69
-
# gRPC connection Ping/Pong service
69
+
##gRPC connection Ping/Pong service
70
70
The library provides a Ping/Pong service facility to test the client/server connection flow. The service helps to establish connection health check status.
71
71
72
72
<b>protos:</b>
@@ -130,12 +130,12 @@ if err != nil {
130
130
c.Log.Infoln("GRPC Pong msg - ", respMsg)
131
131
`````````````````````````````````
132
132
133
-
# Concurrency Pipeline for gRPC Connection Pool
133
+
##Concurrency Pipeline for gRPC Connection Pool
134
134
1. <ahref="https://github.com/Deeptiman/grpc-connection-library/blob/master/pool/connection_pool.go#L170">ConnectionPoolPipeline()</a> follows the concurrency pipeline technique to create a connection pool in a higher concurrent scenarios. The pipeline has several stages that use the <b>Fan-In, Fan-Out</b> technique to process the data pipeline using channels.
135
135
2. The entire process of creating the connection pool becomes a powerful function using the pipeline technique. The four stages work as a generator pattern for the connection pool.
136
136
137
-
## Pipeline Stages
138
-
### Stage-1:
137
+
###Pipeline Stages
138
+
####Stage-1:
139
139
This stage will create the initial gRPC connection instance that gets passed to the next pipeline stage for replication.
@@ -159,7 +159,7 @@ This stage will create the initial gRPC connection instance that gets passed to
159
159
return connCh
160
160
}
161
161
`````````````````````````````````````````````````
162
-
### Stage-2:
162
+
####Stage-2:
163
163
The cloning process of the initial gRPC connection object will begin here. The connection instance gets passed to the next stage iteratively via channels.
This stage will start the batch processing using the <ahref="https://github.com/Deeptiman/go-batch">github.com/Deeptiman/go-batch</a> library. The MaxPoolSize is divided into multiple batches and released via a supply channel from go-batch library internal implementation.
The connection queue reads through the go-batch client supply channel and stores the connection instances as channel case in <b>[]reflect.SelectCase</b>. So, whenever the client requests a connection instance, <b>reflect.SelectCase</b> retrieves the conn instances from the case using the pseudo-random technique.
0 commit comments