MCPcopy
hub / github.com/micro/go-micro / newRPCClient

Function newRPCClient

client/rpc_client.go:40–65  ·  view source on GitHub ↗
(opt ...Option)

Source from the content-addressed store, hash-verified

38}
39
40func newRPCClient(opt ...Option) Client {
41 opts := NewOptions(opt...)
42
43 p := pool.NewPool(
44 pool.Size(opts.PoolSize),
45 pool.TTL(opts.PoolTTL),
46 pool.Transport(opts.Transport),
47 pool.CloseTimeout(opts.PoolCloseTimeout),
48 )
49
50 rc := &rpcClient{
51 opts: opts,
52 pool: p,
53 seq: 0,
54 }
55 rc.once.Store(false)
56
57 c := Client(rc)
58
59 // wrap in reverse
60 for i := len(opts.Wrappers); i > 0; i-- {
61 c = opts.Wrappers[i-1](c)
62 }
63
64 return c
65}
66
67func (r *rpcClient) newCodec(contentType string) (codec.NewCodec, error) {
68 if c, ok := r.opts.Codecs[contentType]; ok {

Callers 1

client.goFile · 0.85

Calls 7

NewPoolFunction · 0.92
SizeFunction · 0.92
TTLFunction · 0.92
TransportFunction · 0.92
CloseTimeoutFunction · 0.92
NewOptionsFunction · 0.70
ClientInterface · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…