Skip to content

grpc-js: waitForReady called multiple times #1352

Closed
@badsyntax

Description

@badsyntax

Problem description

When using client.waitForReady, the ready callback is called multiple times (3 times in this case). Is this is the expected behaviour? I expected it to be called only once. Perhaps I'm misunderstanding the API.

Reproduction steps

I'm constructing the gRPC client (which extends from Client.ts).

import * as grpc from '@grpc/grpc-js';
import { GradleTasksClient as GrpcClient } from './java-gradle-tasks-grpc/src/main/proto/gradle_tasks_grpc_pb';

const grpcClient = new GrpcClient(
  'localhost:8887',
  grpc.credentials.createInsecure()
);
const deadline = new Date();
deadline.setSeconds(deadline.getSeconds() + 1);
grpcClient.waitForReady(deadline, (err: Error | undefined) => {
  console.log('is ready');
});

Environment

  • OS name, version and architecture: macos Catalina 10.15.3 x86_64
  • Node version: v12.16.1
  • Node installation method: nvm
  • Package name and version: @grpc/[email protected]

Screencast

grpc-js-waitforready

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions