// NewServer returns a server that can serve thrift services over TChannel. func NewServer(tchan *tchannel.Channel) *Server { return &Server{ Channel: tchan, log: tchan.Logger(), handlers: make(map[string]TChanServer), } }
// NewZipkinTraceReporter returns a zipkin trace reporter that submits span to tcollector service. func NewZipkinTraceReporter(ch *tc.Channel) *ZipkinTraceReporter { thriftClient := thrift.NewClient(ch, tcollectorServiceName, nil) client := tcollector.NewTChanTCollectorClient(thriftClient) // create the goroutine method to actually to the submit Span. reporter := &ZipkinTraceReporter{ tchannel: ch, client: client, c: make(chan zipkinData, chanBufferSize), logger: ch.Logger(), } go reporter.zipkinSpanWorker() return reporter }