OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. |
| 4 |
| 5 library logging_service; |
| 6 |
| 7 import 'dart:async'; |
| 8 |
| 9 import 'package:protobuf/protobuf.dart'; |
| 10 |
| 11 import 'internal/api_base.pb.dart'; |
| 12 import 'internal/log_service.pb.dart' as pb; |
| 13 import 'rpc/rpc_service.dart'; |
| 14 import '../../api/errors.dart' as errors; |
| 15 |
| 16 class LoggingServiceClientRPCStub { |
| 17 final RPCService _rpcService; |
| 18 final String _ticket; |
| 19 |
| 20 LoggingServiceClientRPCStub(this._rpcService, this._ticket); |
| 21 |
| 22 Future<VoidProto> Flush(pb.FlushRequest request) { |
| 23 return _rpcService.call( |
| 24 'logservice', 'Flush', request.writeToBuffer(), ticket: _ticket) |
| 25 .then((List<int> response) { |
| 26 try { |
| 27 return new VoidProto.fromBuffer(response); |
| 28 } on InvalidProtocolBufferException catch (error) { |
| 29 throw errors.ProtocolError.INVALID_RESPONSE; |
| 30 } |
| 31 }); |
| 32 } |
| 33 } |
OLD | NEW |