@@ -19,18 +19,37 @@ import { CustomTransportStrategy, Server } from '@nestjs/microservices';
19
19
20
20
class GoogleCloudPubSubServer
21
21
extends Server
22
- implements CustomTransportStrategy {
22
+ implements CustomTransportStrategy
23
+ {
23
24
/**
24
- * This method is triggered when you run "app.listen()".
25
+ * Triggered when you run "app.listen()".
25
26
*/
26
27
listen(callback : () => void ) {
27
28
callback ();
28
29
}
29
30
30
31
/**
31
- * This method is triggered on application shutdown.
32
+ * Triggered on application shutdown.
32
33
*/
33
34
close() {}
35
+
36
+ /**
37
+ * You can ignore this method if you don't want transporter users
38
+ * to be able to register event listeners. Most custom implementations
39
+ * will not need this.
40
+ */
41
+ on(event : string , callback : Function ) {
42
+ throw new Error (' Method not implemented.' );
43
+ }
44
+
45
+ /**
46
+ * You can ignore this method if you don't want transporter users
47
+ * to be able to retrieve the underlying native server. Most custom implementations
48
+ * will not need this.
49
+ */
50
+ unwrap<T = never >(): T {
51
+ throw new Error (' Method not implemented.' );
52
+ }
34
53
}
35
54
```
36
55
@@ -137,6 +156,9 @@ class GoogleCloudPubSubClient extends ClientProxy {
137
156
packet : ReadPacket <any >,
138
157
callback : (packet : WritePacket <any >) => void ,
139
158
): Function {}
159
+ unwrap<T = never >(): T {
160
+ throw new Error (' Method not implemented.' );
161
+ }
140
162
}
141
163
```
142
164
@@ -174,6 +196,10 @@ class GoogleCloudPubSubClient extends ClientProxy {
174
196
175
197
return () => console .log (' teardown' );
176
198
}
199
+
200
+ unwrap<T = never >(): T {
201
+ throw new Error (' Method not implemented.' );
202
+ }
177
203
}
178
204
```
179
205
0 commit comments