Skip to content

Instantly share code, notes, and snippets.

@jwulf
Last active February 29, 2020 17:11
Show Gist options
  • Save jwulf/9e44a5ddc0b2e124943edd30bee04734 to your computer and use it in GitHub Desktop.
Save jwulf/9e44a5ddc0b2e124943edd30bee04734 to your computer and use it in GitHub Desktop.
export class GrpcMiddleware {
private grpcClient: GrpcClient
private characteristics: Characteristics
private log: ZBLogger
constructor({
profile,
config,
}: {
profile: GrpcConnectionProfile
config: GrpcClientCtor
}) {
this.grpcClient = new GrpcClient(config)
this.characteristics = ConnectionCharacteristics[profile]
this.log = new ZBLogger({
color: chalk.green,
id: 'gRPC Channel',
loglevel: config.loglevel,
namespace: config.namespace,
pollInterval: config.options.longPoll!,
stdout: config,
taskType: config.tasktype,
})
}
public getGrpcClient() {
re turn this.grpcClient
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment