starpc 0.3.1 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,6 +4,7 @@ import type { OpenStreamFunc } from './stream.js';
4
4
  export declare class Client implements TsProtoRpc {
5
5
  private openConnFn;
6
6
  constructor(openConnFn: OpenStreamFunc);
7
+ setOpenConnFn(openConnFn: OpenStreamFunc): void;
7
8
  request(service: string, method: string, data: Uint8Array): Promise<Uint8Array>;
8
9
  clientStreamingRequest(service: string, method: string, data: Observable<Uint8Array>): Promise<Uint8Array>;
9
10
  serverStreamingRequest(service: string, method: string, data: Uint8Array): Observable<Uint8Array>;
@@ -25,6 +25,10 @@ export class Client {
25
25
  constructor(openConnFn) {
26
26
  this.openConnFn = openConnFn;
27
27
  }
28
+ // setOpenConnFn updates the openConnFn for the Client.
29
+ setOpenConnFn(openConnFn) {
30
+ this.openConnFn = openConnFn;
31
+ }
28
32
  // request starts a non-streaming request.
29
33
  async request(service, method, data) {
30
34
  const call = await this.startRpc(service, method, data);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "starpc",
3
- "version": "0.3.1",
3
+ "version": "0.3.2",
4
4
  "description": "Streaming protobuf RPC service protocol over any two-way channel.",
5
5
  "license": "MIT",
6
6
  "author": {
package/srpc/client.ts CHANGED
@@ -37,6 +37,11 @@ export class Client implements TsProtoRpc {
37
37
  this.openConnFn = openConnFn
38
38
  }
39
39
 
40
+ // setOpenConnFn updates the openConnFn for the Client.
41
+ public setOpenConnFn(openConnFn: OpenStreamFunc) {
42
+ this.openConnFn = openConnFn
43
+ }
44
+
40
45
  // request starts a non-streaming request.
41
46
  public async request(
42
47
  service: string,