WIP request ids + trace context

This commit is contained in:
Christian Schwarz
2020-01-15 17:37:23 +01:00
parent b8d9f4ba92
commit 1bd0dcfca6
16 changed files with 227 additions and 37 deletions
+7 -3
View File
@@ -26,6 +26,7 @@ import (
// Client implements the active side of a replication setup.
// It satisfies the Endpoint, Sender and Receiver interface defined by package replication.
type Client struct {
reqIDGen *requestIDGenerator
dataClient *dataconn.Client
controlClient pdu.ReplicationClient // this the grpc client instance, see constructor
controlConn *grpc.ClientConn
@@ -47,10 +48,13 @@ func NewClient(cn transport.Connecter, loggers Loggers) *Client {
muxedConnecter := mux(cn)
c := &Client{
loggers: loggers,
closed: make(chan struct{}),
loggers: loggers,
closed: make(chan struct{}),
reqIDGen: newRequestIDGenerator(),
}
grpcConn := grpchelper.ClientConn(muxedConnecter.control, loggers.Control)
grpcConn := grpchelper.ClientConn(muxedConnecter.control, loggers.Control, func() string {
return c.reqIDGen.newID().String()
})
go func() {
ctx, cancel := context.WithCancel(context.Background())