All Projects → 0x5010 → grpcp

0x5010 / grpcp

Licence: MIT license
grpcp is a Grpc Persistent Connection Pool.

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to grpcp

Pool
General Purpose Connection Pool for GRPC,RPC,TCP Sevice Cluster
Stars: ✭ 98 (+2.08%)
Mutual labels:  grpc, connection-pool
protoc-plugin
A protoc compiler plugin for Clojure applications
Stars: ✭ 28 (-70.83%)
Mutual labels:  grpc
Go Grpc Http Rest Microservice Tutorial
Source code for tutorial "How to develop Go gRPC microservice with HTTP/REST endpoint, middleware, Kubernetes deployment, etc."
Stars: ✭ 250 (+160.42%)
Mutual labels:  grpc
conn
netpoll事件驱动,goroutine协程池化,降低无效协程的资源占用,适用于高连接数(对于低频数据传输的场景,可以大幅降低协程数,提升资源利用率)
Stars: ✭ 28 (-70.83%)
Mutual labels:  connection-pool
Devops
Study Guides for DevOps Proffessionals https://gofunct.github.io/devops/.
Stars: ✭ 254 (+164.58%)
Mutual labels:  grpc
node-redshift
A simple collection of tools to help you get started with Amazon Redshift from node.js
Stars: ✭ 66 (-31.25%)
Mutual labels:  connection-pool
Grpc Swagger
Debugging gRPC application with swagger-ui.
Stars: ✭ 242 (+152.08%)
Mutual labels:  grpc
rpc ts
Remote Procedure Calls in TypeScript made simple 🤞
Stars: ✭ 71 (-26.04%)
Mutual labels:  grpc
qtprotobuf
Protobuf generator and bindings for Qt framework
Stars: ✭ 138 (+43.75%)
Mutual labels:  grpc
pool
Go library that wraps http.Client to provide seamless higher-level connection pooling features
Stars: ✭ 39 (-59.37%)
Mutual labels:  connection-pool
Polyel-Framework
⚡️ Voltis Core: A PHP framework based on Swoole from the ground up
Stars: ✭ 22 (-77.08%)
Mutual labels:  connection-pool
Converge
A powerful and easy-to-use configuration management system.
Stars: ✭ 254 (+164.58%)
Mutual labels:  grpc
neofs-api-go
NeoFS API Golang repository contains implementation of core NeoFS structures that can be used for integration with NeoFS.
Stars: ✭ 14 (-85.42%)
Mutual labels:  grpc
Gripmock
gRPC Mock Server
Stars: ✭ 248 (+158.33%)
Mutual labels:  grpc
jobor
支持秒级分布式定时任务系统, A high performance distributed task scheduling system, Support multi protocol scheduling tasks
Stars: ✭ 52 (-45.83%)
Mutual labels:  grpc
Netcorekit
💗 A crafted toolkit for building cloud-native apps on the .NET platform
Stars: ✭ 248 (+158.33%)
Mutual labels:  grpc
PyMySQLPool
PyMySQL-based database connection pool.
Stars: ✭ 52 (-45.83%)
Mutual labels:  connection-pool
vertica-swoole-adapter
Provides a DB layer for Swoole-based applications to communicate to HP Vertica databases.
Stars: ✭ 14 (-85.42%)
Mutual labels:  connection-pool
grpc-firewall-bypass
initiate connections to gRPC servers that live behind a firewall (https://github.com/grpc/grpc-go/issues/484)
Stars: ✭ 53 (-44.79%)
Mutual labels:  grpc
FSharp.GrpcCodeGenerator
A protoc plugin to enable generation of F# code
Stars: ✭ 61 (-36.46%)
Mutual labels:  grpc

grpcp is a Grpc Persistent Connection Pool.

LICENSE Build Status codecov Go Report Card Godoc

Installation

go get -u github.com/0x5010/grpcp

Usage

default

import (
    "context"
    "fmt"

    "google.golang.org/grpc"
    pb "google.golang.org/grpc/examples/helloworld/helloworld"
)

func main() {
    var addr, name string
    conn, _ := grpc.Dial(addr, grpc.WithInsecure())
    defer conn.Close()
    client := pb.NewGreeterClient(conn)
    r, _ := client.SayHello(context.Background(), &pb.HelloRequest{Name: name})
    fmt.Println(r.GetMessage())
}

with grpcp

import (
    "context"
    "fmt"

    "google.golang.org/grpc"
    pb "google.golang.org/grpc/examples/helloworld/helloworld"
)

func main() {
    var addr, name string

    conn, _ := grpcp.GetConn(addr)  // get conn with grpcp default pool
    // defer conn.Close()  // no close, close will disconnect
    client := pb.NewGreeterClient(conn)
    r, _ := client.SayHello(context.Background(), &pb.HelloRequest{Name: name})
    fmt.Println(r.GetMessage())
}

custom dial function

import (
    "context"
    "fmt"

    "github.com/0x5010/grpcp"
    "google.golang.org/grpc"
    pb "google.golang.org/grpc/examples/helloworld/helloworld"
)

func main() {
    var addr, name string

    pool := grpcp.New(func(addr string) (*grpc.ClientConn, error) {
        return grpc.Dial(
            addr,
            grpc.WithInsecure(),
        )
    })
    conn, _ := pool.GetConn(addr)

    client := pb.NewGreeterClient(conn)
    r, _ := client.SayHello(context.Background(), &pb.HelloRequest{Name: name})
    fmt.Println(r.GetMessage())
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].