コード例 #1
0
    def Export(self, request, context):
        context.set_code(StatusCode.UNAVAILABLE)

        context.send_initial_metadata(
            (("google.rpc.retryinfo-bin", RetryInfo().SerializeToString()), ))
        context.set_trailing_metadata(((
            "google.rpc.retryinfo-bin",
            RetryInfo(retry_delay=Duration(seconds=4)).SerializeToString(),
        ), ))

        return ExportTraceServiceResponse()
コード例 #2
0
    def Export(self, request, context):
        context.set_code(StatusCode.OK)

        return ExportTraceServiceResponse()