// doneSending shuts down the message exchange for this call.
// For incoming calls, the last message is sending the call response.
doneSending shuts down the message exchange for this call.
For incoming calls, the last message is sending the call response.
// doneSending shuts down the message exchange for this call . // For incoming calls the last message is sending the call response .
func (response *InboundCallResponse) doneSending() {
	now := response.timeNow()
	if span := response.span; span != nil {
		if response.applicationError || response.systemError {
			ext.Error.Set(span, true)
		}
		span.FinishWithOptions(opentracing.FinishOptions{FinishTime: now})
	}
	latency := now.Sub(response.calledAt)
	response.statsReporter.RecordTimer("inbound.calls.latency", response.commonStatsTags, latency)
	if response.systemError {
	} else if response.applicationError {
		response.statsReporter.IncCounter("inbound.calls.app-errors", response.commonStatsTags, 1)
	} else {
		response.statsReporter.IncCounter("inbound.calls.success", response.commonStatsTags, 1)
	}
	response.cancel()
	if response.err == nil {
		response.mex.shutdown()
	}
}
func ( response * InboundCallResponse ) doneSending ( ) { now := response . timeNow ( ) if span := response . span ; span != nil { if response . applicationError || response . systemError { ext . Error . Set ( span , true ) } span . FinishWithOptions ( opentracing . FinishOptions { FinishTime : now } ) } latency := now . Sub ( response . calledAt ) response . statsReporter . RecordTimer ( " " , response . commonStatsTags , latency ) if response . systemError { } else if response . applicationError { response . statsReporter . IncCounter ( " " , response . commonStatsTags , 1 ) } else { response . statsReporter . IncCounter ( " " , response . commonStatsTags , 1 ) } response . cancel ( ) if response . err == nil { response . mex . shutdown ( ) } }
doneSending shuts down the message exchange for this call.
doneSending shuts down the message exchange for this call .
// TODO(prashant): Move this to when the message is actually being sent. // TODO(prashant): Report the error code type as per metrics doc and enable. // response.statsReporter.IncCounter("inbound.calls.system-errors", response.commonStatsTags, 1) // Cancel the context since the response is complete. // The message exchange is still open if there are no errors, call shutdown.