starpc 0.4.9 → 0.5.0
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/Makefile +1 -0
- package/README.md +20 -10
- package/dist/echo/client-test.d.ts +1 -0
- package/dist/echo/client-test.js +20 -18
- package/dist/echo/echo.pb.d.ts +165 -12
- package/dist/echo/echo.pb.js +61 -17
- package/dist/echo/server.d.ts +8 -4
- package/dist/echo/server.js +29 -37
- package/dist/rpcstream/rpcstream.d.ts +6 -6
- package/dist/rpcstream/rpcstream.js +92 -51
- package/dist/rpcstream/rpcstream.pb.d.ts +46 -1
- package/dist/rpcstream/rpcstream.pb.js +157 -9
- package/dist/srpc/client.d.ts +3 -4
- package/dist/srpc/client.js +12 -46
- package/dist/srpc/common-rpc.d.ts +3 -2
- package/dist/srpc/common-rpc.js +12 -0
- package/dist/srpc/definition.d.ts +3 -3
- package/dist/srpc/handler.d.ts +2 -3
- package/dist/srpc/handler.js +5 -22
- package/dist/srpc/index.d.ts +1 -1
- package/dist/srpc/index.js +1 -1
- package/dist/srpc/packet.js +0 -32
- package/dist/srpc/pushable.d.ts +2 -0
- package/dist/srpc/pushable.js +13 -0
- package/dist/srpc/rpcproto.pb.d.ts +13 -6
- package/dist/srpc/rpcproto.pb.js +95 -10
- package/dist/srpc/server.d.ts +1 -0
- package/dist/srpc/server.js +7 -0
- package/dist/srpc/ts-proto-rpc.d.ts +3 -4
- package/e2e/e2e.ts +4 -3
- package/e2e/e2e_test.go +24 -1
- package/echo/client-test.ts +23 -18
- package/echo/echo.pb.go +33 -20
- package/echo/echo.pb.ts +90 -34
- package/echo/echo.proto +4 -0
- package/echo/echo_srpc.pb.go +77 -0
- package/echo/server.go +18 -0
- package/echo/server.ts +47 -41
- package/integration/integration.go +1 -2
- package/integration/integration.ts +5 -1
- package/integration/integration_srpc.pb.go +139 -0
- package/package.json +5 -3
- package/patches/ts-proto+1.115.5.patch +1339 -0
- package/srpc/client.ts +16 -50
- package/srpc/common-rpc.ts +14 -2
- package/srpc/definition.ts +3 -3
- package/srpc/handler.ts +17 -34
- package/srpc/index.ts +1 -1
- package/srpc/muxed-conn.go +2 -2
- package/srpc/packet-rw.go +4 -6
- package/srpc/packet.ts +0 -33
- package/srpc/pushable.ts +17 -0
- package/srpc/rpcproto.pb.ts +122 -12
- package/srpc/server-pipe.go +2 -2
- package/srpc/server.go +2 -2
- package/srpc/server.ts +8 -0
- package/srpc/ts-proto-rpc.ts +4 -6
- package/srpc/websocket.go +2 -2
- package/dist/echo/sever.d.ts +0 -0
- package/dist/echo/sever.js +0 -1
- package/dist/srpc/observable-source.d.ts +0 -9
- package/dist/srpc/observable-source.js +0 -25
- package/echo/sever.ts +0 -0
- package/srpc/observable-source.ts +0 -40
package/dist/echo/sever.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Source } from 'it-stream-types';
|
|
2
|
-
import { Observable } from 'rxjs';
|
|
3
|
-
export declare class ObservableSource<T> {
|
|
4
|
-
readonly source: Source<T>;
|
|
5
|
-
private readonly _source;
|
|
6
|
-
private readonly subscription;
|
|
7
|
-
constructor(observable: Observable<T>);
|
|
8
|
-
close(err?: Error): void;
|
|
9
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { pushable } from 'it-pushable';
|
|
2
|
-
// ObservableSource wraps an Observable into a Source.
|
|
3
|
-
export class ObservableSource {
|
|
4
|
-
constructor(observable) {
|
|
5
|
-
const source = pushable({ objectMode: true });
|
|
6
|
-
this.source = source;
|
|
7
|
-
this._source = source;
|
|
8
|
-
this.subscription = observable.subscribe({
|
|
9
|
-
next: (value) => {
|
|
10
|
-
this._source.push(value);
|
|
11
|
-
},
|
|
12
|
-
error: (err) => {
|
|
13
|
-
this._source.end(err);
|
|
14
|
-
},
|
|
15
|
-
complete: () => {
|
|
16
|
-
this._source.end();
|
|
17
|
-
},
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
// close closes the subscription.
|
|
21
|
-
close(err) {
|
|
22
|
-
this._source.end(err);
|
|
23
|
-
this.subscription.unsubscribe();
|
|
24
|
-
}
|
|
25
|
-
}
|
package/echo/sever.ts
DELETED
|
File without changes
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { Source } from 'it-stream-types'
|
|
2
|
-
import { pushable, Pushable } from 'it-pushable'
|
|
3
|
-
import { Observable, Subscription } from 'rxjs'
|
|
4
|
-
|
|
5
|
-
// ObservableSource wraps an Observable into a Source.
|
|
6
|
-
export class ObservableSource<T> {
|
|
7
|
-
// source is the source for observable objects.
|
|
8
|
-
public readonly source: Source<T>
|
|
9
|
-
// _source emits incoming data to the source.
|
|
10
|
-
private readonly _source: {
|
|
11
|
-
push: (val: T) => void
|
|
12
|
-
end: (err?: Error) => void
|
|
13
|
-
}
|
|
14
|
-
// subscription is the observable subscription
|
|
15
|
-
private readonly subscription: Subscription
|
|
16
|
-
|
|
17
|
-
constructor(observable: Observable<T>) {
|
|
18
|
-
const source: Pushable<T> = pushable({ objectMode: true })
|
|
19
|
-
this.source = source
|
|
20
|
-
this._source = source
|
|
21
|
-
|
|
22
|
-
this.subscription = observable.subscribe({
|
|
23
|
-
next: (value: T) => {
|
|
24
|
-
this._source.push(value)
|
|
25
|
-
},
|
|
26
|
-
error: (err) => {
|
|
27
|
-
this._source.end(err)
|
|
28
|
-
},
|
|
29
|
-
complete: () => {
|
|
30
|
-
this._source.end()
|
|
31
|
-
},
|
|
32
|
-
})
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
// close closes the subscription.
|
|
36
|
-
public close(err?: Error) {
|
|
37
|
-
this._source.end(err)
|
|
38
|
-
this.subscription.unsubscribe()
|
|
39
|
-
}
|
|
40
|
-
}
|