Skip to content

Commit 9916076

Browse files
committed
Rework library to be compatible with grpc-js
1 parent 1e40c4d commit 9916076

File tree

7 files changed

+1268
-1251
lines changed

7 files changed

+1268
-1251
lines changed

grpc-gcp/package.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "grpc-gcp",
3-
"version": "0.2.0",
3+
"version": "0.3.0",
44
"description": "Extension for supporting Google Cloud Platform specific features for gRPC.",
55
"main": "build/src/index.js",
66
"scripts": {
@@ -34,11 +34,9 @@
3434
"engines": {
3535
"node": ">=6"
3636
},
37-
"dependencies": {
38-
"grpc": "^1.16.0",
39-
"protobufjs": "^6.8.8"
40-
},
37+
"dependencies": {},
4138
"devDependencies": {
39+
"@grpc/grpc-js": "^0.7.3",
4240
"@grpc/proto-loader": "0.4.0",
4341
"eslint": "5.15.3",
4442
"eslint-config-prettier": "4.1.0",
@@ -48,6 +46,7 @@
4846
"google-gax": "0.25.5",
4947
"google-protobuf": "3.7.0",
5048
"grpc-tools": "1.7.1",
49+
"grpc": "^1.24.2",
5150
"gts": "0.9.0",
5251
"mocha": "6.0.2",
5352
"nyc": "13.3.0",

grpc-gcp/src/channel_ref.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@
1616
*
1717
*/
1818

19-
import {Channel} from 'grpc';
19+
import * as grpc from '@grpc/grpc-js';
2020

2121
/**
2222
* A wrapper of real grpc channel. Also provides helper functions to
2323
* calculate affinity counts and active streams count.
2424
*/
2525
export class ChannelRef {
26-
private readonly channel: Channel;
26+
private readonly channel: grpc.ChannelInterface;
2727
private readonly channelId: number;
2828
private affinityCount: number;
2929
private activeStreamsCount: number;
@@ -35,7 +35,7 @@ export class ChannelRef {
3535
* @param activeStreamsCount Initial streams count.
3636
*/
3737
constructor(
38-
channel: Channel,
38+
channel: grpc.ChannelInterface,
3939
channelId: number,
4040
affinityCount?: number,
4141
activeStreamsCount?: number

0 commit comments

Comments
 (0)