How to use the connectivityState function from bindings

Find comprehensive JavaScript bindings.connectivityState code examples handpicked from public code repositorys.

696
697
698
699
700
701
702
703
704
705
  callback(new Error('Failed to connect before the deadline'));
}
var new_state = client.$channel.getConnectivityState(true);
if (new_state === grpc.connectivityState.READY) {
  callback();
} else if (new_state === grpc.connectivityState.FATAL_FAILURE) {
  callback(new Error('Failed to connect to server'));
} else {
  client.$channel.watchConnectivityState(new_state, deadline, checkState);
}
fork icon1
star icon0
watch icon0

+ 9 other calls in file

135
136
137
138
139
140
141
142
143
144
  beforeEach(function() {
    channel = new grpc.Channel('hostname', insecureCreds, {});
  });
  it('should return IDLE for a new channel', function() {
    assert.strictEqual(channel.getConnectivityState(),
                       grpc.connectivityState.IDLE);
  });
});
describe('watchConnectivityState', function() {
  var channel;
fork icon1
star icon0
watch icon0

Other functions in bindings

Sorted by popularity

function icon

bindings.createKey is the most popular function in bindings (8616 examples)