Warlock
grpcpool grpc client Connection pool
Install / Use
/learn @ruiboma/WarlockREADME
warlock -- grpc client Connection pool
This is the golang grpc client connection pool tool
Complete link state detection mechanism Every link obtained is efficient.
Project Maturity
Basic api will not have more changes. They will be discussed on Github issues along with any bugs or enhancements
Goals
Provide a few interfaces, as efficient, stable and flexible as possible.
Doc
HOW TO USE
go get github.com/ruiboma/warlock
package main
import (
"github.com/ruiboma/warlock"
"google.golang.org/grpc"
pb "google.golang.org/grpc/examples/helloworld/helloworld"
)
func main() {
cfg := warlock.NewConfig()
cfg.ServerAdds = &[]string{"127.0.0.1:50051"}
// or
cfg := warlock.NewConfig(warlock.OptionNoOverFlow, warlock.WithServerAdd(&[]string{"127.0.0.1:50051"}))
pool, err := warlock.NewWarlock(cfg, grpc.WithInsecure())
conn, close, err := pool.Acquire()
defer close()
/*
Connection pool is not necessary for grpc
used, free := pool.Getstat() // Can view usage and free quantities
cfg.OverflowCap = true This configuration may cause the existing link to exceed the total number set.
If it overflows for a long time you need to consider increasing the value of cap.
defer pool.ClearPool() // Close all existing links with the pool before exiting the program
defer close() // It is recommended to use this, or <pool.Close(conn)> func
*/
License
see LICENSE for more details.
Related Skills
node-connect
349.2kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
109.5kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
349.2kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
349.2kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
