starpc 0.36.3 → 0.36.4

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.
package/README.md CHANGED
@@ -166,7 +166,7 @@ import { pushable } from 'it-pushable'
166
166
  const mux = createMux()
167
167
  const echoer = new EchoerServer()
168
168
  mux.register(createHandler(EchoerDefinition, echoer))
169
- const server = new Server(mux.lookupMethodFunc)
169
+ const server = new Server(mux.lookupMethod)
170
170
 
171
171
  // Create the client connection to the server with an in-memory pipe.
172
172
  const clientConn = new Conn()
@@ -7,10 +7,10 @@ export declare function createMux(): StaticMux;
7
7
  export declare class StaticMux implements Mux {
8
8
  private services;
9
9
  private lookups;
10
- get lookupMethodFunc(): LookupMethod;
10
+ get lookupMethod(): LookupMethod;
11
11
  register(handler: Handler): void;
12
12
  registerLookupMethod(lookupMethod: LookupMethod): void;
13
- lookupMethod(serviceID: string, methodID: string): Promise<InvokeFn | null>;
13
+ private _lookupMethod;
14
14
  private lookupViaMap;
15
15
  private lookupViaLookups;
16
16
  }
package/dist/srpc/mux.js CHANGED
@@ -10,9 +10,9 @@ export class StaticMux {
10
10
  // lookups is the list of lookup methods to call.
11
11
  // called if the method is not resolved by the services list.
12
12
  lookups = [];
13
- // lookupMethodFunc implements the LookupMethod type.
14
- get lookupMethodFunc() {
15
- return this.lookupMethod.bind(this);
13
+ // lookupMethod implements the LookupMethod type.
14
+ get lookupMethod() {
15
+ return this._lookupMethod.bind(this);
16
16
  }
17
17
  register(handler) {
18
18
  const serviceID = handler?.getServiceID();
@@ -30,7 +30,7 @@ export class StaticMux {
30
30
  registerLookupMethod(lookupMethod) {
31
31
  this.lookups.push(lookupMethod);
32
32
  }
33
- async lookupMethod(serviceID, methodID) {
33
+ async _lookupMethod(serviceID, methodID) {
34
34
  if (serviceID) {
35
35
  const invokeFn = await this.lookupViaMap(serviceID, methodID);
36
36
  if (invokeFn) {
@@ -7,7 +7,7 @@ describe('srpc server', () => {
7
7
  let client;
8
8
  beforeEach(async () => {
9
9
  const mux = createMux();
10
- const server = new Server(mux.lookupMethodFunc);
10
+ const server = new Server(mux.lookupMethod);
11
11
  const echoer = new EchoerServer(server);
12
12
  mux.register(createHandler(EchoerDefinition, echoer));
13
13
  // StreamConn is unnecessary since ChannelStream has packet framing.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "starpc",
3
- "version": "0.36.3",
3
+ "version": "0.36.4",
4
4
  "description": "Streaming protobuf RPC service protocol over any two-way channel.",
5
5
  "license": "MIT",
6
6
  "author": {
package/srpc/mux.ts CHANGED
@@ -30,9 +30,9 @@ export class StaticMux implements Mux {
30
30
  // called if the method is not resolved by the services list.
31
31
  private lookups: LookupMethod[] = []
32
32
 
33
- // lookupMethodFunc implements the LookupMethod type.
34
- public get lookupMethodFunc(): LookupMethod {
35
- return this.lookupMethod.bind(this)
33
+ // lookupMethod implements the LookupMethod type.
34
+ public get lookupMethod(): LookupMethod {
35
+ return this._lookupMethod.bind(this)
36
36
  }
37
37
 
38
38
  public register(handler: Handler): void {
@@ -53,7 +53,7 @@ export class StaticMux implements Mux {
53
53
  this.lookups.push(lookupMethod)
54
54
  }
55
55
 
56
- public async lookupMethod(
56
+ private async _lookupMethod(
57
57
  serviceID: string,
58
58
  methodID: string,
59
59
  ): Promise<InvokeFn | null> {
@@ -21,7 +21,7 @@ describe('srpc server', () => {
21
21
 
22
22
  beforeEach(async () => {
23
23
  const mux = createMux()
24
- const server = new Server(mux.lookupMethodFunc)
24
+ const server = new Server(mux.lookupMethod)
25
25
  const echoer = new EchoerServer(server)
26
26
  mux.register(createHandler(EchoerDefinition, echoer))
27
27