File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed
Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change 3030 "@types/node" : " ^12.12.42" ,
3131 "@types/request" : " 2.48.0" ,
3232 "chai" : " ^3.5.0" ,
33- "grpc-tools" : " ^1.8.1 " ,
33+ "grpc-tools" : " ^1.9.0 " ,
3434 "kafka-node" : " 2.6.1" ,
3535 "mocha" : " ^7.1.2" ,
3636 "npm-registry-package-info" : " 1.0.5" ,
Original file line number Diff line number Diff line change 1515 */
1616
1717import * as grpc from '@grpc/grpc-js' ;
18- import { SpanAgent } from '../proto_idl_codegen/agent/spanAgent_grpc_pb' ;
18+ import * as spanAgentPackageDefinition from '../proto_idl_codegen/agent/spanAgent_grpc_pb' ;
1919import { Dispatcher } from './dispatcher' ;
2020import Span from '../span' ;
2121import { Logger , NullLogger } from '../logger' ;
2222import Utils from '../utils' ;
23+ import { ServiceClientConstructor } from '@grpc/grpc-js/build/src/make-client' ;
2324
2425export default class RemoteDispatcher implements Dispatcher {
2526 _client : any ;
2627 _logger : any ;
2728
2829 constructor ( agentHost : string = 'haystack-agent' , agentPort : number = 35000 , logger : Logger = new NullLogger ( ) ) {
2930 logger . info ( `Initializing the remote grpc agent dispatcher, connecting at ${ agentHost } :${ agentPort } ` ) ;
30- const spanAgentClient = grpc . makeGenericClientConstructor ( SpanAgent , 'SpanAgentService' ) ;
31- this . _client = new spanAgentClient ( `${ agentHost } :${ agentPort } ` , grpc . credentials . createInsecure ( ) ) ;
31+ const protoDescriptor = grpc . loadPackageDefinition ( spanAgentPackageDefinition ) as { [ index : string ] : ServiceClientConstructor } ;
32+ this . _client = new protoDescriptor . SpanAgent ( `${ agentHost } :${ agentPort } ` , grpc . credentials . createInsecure ( ) ) ;
3233 this . _logger = logger ;
3334 }
3435
You can’t perform that action at this time.
0 commit comments