@nsshunt/stsappframework 3.1.213 → 3.1.215
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/dist/commonTypes.js.map +1 -1
- package/dist/index.js +1 -7
- package/dist/index.js.map +1 -1
- package/dist/masterprocessbase.js +33 -46
- package/dist/masterprocessbase.js.map +1 -1
- package/dist/processbase.js +29 -0
- package/dist/processbase.js.map +1 -1
- package/dist/serverprocessbase.js +51 -66
- package/dist/serverprocessbase.js.map +1 -1
- package/dist/stscontrollerbase.js.map +1 -1
- package/dist/{server.js → stsexpressserver.js} +1 -1
- package/dist/stsexpressserver.js.map +1 -0
- package/dist/stslatencycontroller.js.map +1 -1
- package/dist/stslatencyroute.js.map +1 -1
- package/dist/stsrouterbase.js.map +1 -1
- package/dist/vitesttesting/appSingleWSS.js +2 -1
- package/dist/vitesttesting/appSingleWSS.js.map +1 -1
- package/dist/workerprocessbase.js.map +1 -1
- package/package.json +5 -6
- package/src/commonTypes.ts +2 -0
- package/src/index.ts +1 -7
- package/src/masterprocessbase.ts +42 -55
- package/src/processbase.ts +32 -1
- package/src/serverprocessbase.ts +55 -72
- package/src/{socketIoServerHelper.ts → socketIoServerHelper.ts_bak} +1 -2
- package/src/stscontrollerbase.ts +1 -2
- package/src/{server.ts → stsexpressserver.ts} +1 -2
- package/src/stslatencycontroller.ts +1 -2
- package/src/stslatencyroute.ts +1 -2
- package/src/stsrouterbase.ts +1 -2
- package/src/vitesttesting/appSingleWSS.ts +2 -1
- package/src/workerprocessbase.ts +1 -2
- package/types/commonTypes.d.ts +0 -15
- package/types/commonTypes.d.ts.map +1 -1
- package/types/index.d.ts +0 -7
- package/types/index.d.ts.map +1 -1
- package/types/masterprocessbase.d.ts.map +1 -1
- package/types/processbase.d.ts +3 -0
- package/types/processbase.d.ts.map +1 -1
- package/types/serverprocessbase.d.ts +3 -1
- package/types/serverprocessbase.d.ts.map +1 -1
- package/types/stscontrollerbase.d.ts.map +1 -1
- package/types/{server.d.ts → stsexpressserver.d.ts} +1 -1
- package/types/stsexpressserver.d.ts.map +1 -0
- package/types/stslatencycontroller.d.ts.map +1 -1
- package/types/stslatencyroute.d.ts.map +1 -1
- package/types/stsrouterbase.d.ts.map +1 -1
- package/types/vitesttesting/appSingleWSS.d.ts.map +1 -1
- package/types/workerprocessbase.d.ts.map +1 -1
- package/dist/authDefs.js +0 -33
- package/dist/authDefs.js.map +0 -1
- package/dist/gRPC/ststest/protos/auth_sample.js +0 -3
- package/dist/gRPC/ststest/protos/auth_sample.js.map +0 -1
- package/dist/gRPC/ststest/protos/echo.js +0 -3
- package/dist/gRPC/ststest/protos/echo.js.map +0 -1
- package/dist/gRPC/ststest/protos/grpc/examples/echo/Echo.js +0 -4
- package/dist/gRPC/ststest/protos/grpc/examples/echo/Echo.js.map +0 -1
- package/dist/gRPC/ststest/protos/grpc/examples/echo/EchoRequest.js +0 -4
- package/dist/gRPC/ststest/protos/grpc/examples/echo/EchoRequest.js.map +0 -1
- package/dist/gRPC/ststest/protos/grpc/examples/echo/EchoResponse.js +0 -4
- package/dist/gRPC/ststest/protos/grpc/examples/echo/EchoResponse.js.map +0 -1
- package/dist/gRPC/ststest/protos/grpc/testing/Request.js +0 -4
- package/dist/gRPC/ststest/protos/grpc/testing/Request.js.map +0 -1
- package/dist/gRPC/ststest/protos/grpc/testing/Response.js +0 -4
- package/dist/gRPC/ststest/protos/grpc/testing/Response.js.map +0 -1
- package/dist/gRPC/ststest/protos/grpc/testing/TestService.js +0 -4
- package/dist/gRPC/ststest/protos/grpc/testing/TestService.js.map +0 -1
- package/dist/gRPC/ststest/protos/hellostreamingworld/HelloReply.js +0 -4
- package/dist/gRPC/ststest/protos/hellostreamingworld/HelloReply.js.map +0 -1
- package/dist/gRPC/ststest/protos/hellostreamingworld/HelloRequest.js +0 -4
- package/dist/gRPC/ststest/protos/hellostreamingworld/HelloRequest.js.map +0 -1
- package/dist/gRPC/ststest/protos/hellostreamingworld/MultiGreeter.js +0 -4
- package/dist/gRPC/ststest/protos/hellostreamingworld/MultiGreeter.js.map +0 -1
- package/dist/gRPC/ststest/protos/hellostreamingworld.js +0 -3
- package/dist/gRPC/ststest/protos/hellostreamingworld.js.map +0 -1
- package/dist/gRPC/ststest/protos/helloworld/Greeter.js +0 -4
- package/dist/gRPC/ststest/protos/helloworld/Greeter.js.map +0 -1
- package/dist/gRPC/ststest/protos/helloworld/HelloReply.js +0 -4
- package/dist/gRPC/ststest/protos/helloworld/HelloReply.js.map +0 -1
- package/dist/gRPC/ststest/protos/helloworld/HelloRequest.js +0 -4
- package/dist/gRPC/ststest/protos/helloworld/HelloRequest.js.map +0 -1
- package/dist/gRPC/ststest/protos/helloworld.js +0 -3
- package/dist/gRPC/ststest/protos/helloworld.js.map +0 -1
- package/dist/gRPC/ststest/protos/keyvaluestore/KeyValueStore.js +0 -4
- package/dist/gRPC/ststest/protos/keyvaluestore/KeyValueStore.js.map +0 -1
- package/dist/gRPC/ststest/protos/keyvaluestore/Request.js +0 -4
- package/dist/gRPC/ststest/protos/keyvaluestore/Request.js.map +0 -1
- package/dist/gRPC/ststest/protos/keyvaluestore/Response.js +0 -4
- package/dist/gRPC/ststest/protos/keyvaluestore/Response.js.map +0 -1
- package/dist/gRPC/ststest/protos/keyvaluestore.js +0 -3
- package/dist/gRPC/ststest/protos/keyvaluestore.js.map +0 -1
- package/dist/gRPC/ststest/protos/route_guide.js +0 -3
- package/dist/gRPC/ststest/protos/route_guide.js.map +0 -1
- package/dist/gRPC/ststest/protos/routeguide/Feature.js +0 -4
- package/dist/gRPC/ststest/protos/routeguide/Feature.js.map +0 -1
- package/dist/gRPC/ststest/protos/routeguide/Point.js +0 -4
- package/dist/gRPC/ststest/protos/routeguide/Point.js.map +0 -1
- package/dist/gRPC/ststest/protos/routeguide/Rectangle.js +0 -4
- package/dist/gRPC/ststest/protos/routeguide/Rectangle.js.map +0 -1
- package/dist/gRPC/ststest/protos/routeguide/RouteGuide.js +0 -4
- package/dist/gRPC/ststest/protos/routeguide/RouteGuide.js.map +0 -1
- package/dist/gRPC/ststest/protos/routeguide/RouteNote.js +0 -4
- package/dist/gRPC/ststest/protos/routeguide/RouteNote.js.map +0 -1
- package/dist/gRPC/ststest/protos/routeguide/RouteSummary.js +0 -4
- package/dist/gRPC/ststest/protos/routeguide/RouteSummary.js.map +0 -1
- package/dist/gRPC/ststest/src/commonTypes.js +0 -3
- package/dist/gRPC/ststest/src/commonTypes.js.map +0 -1
- package/dist/gRPC/ststest/src/greeter_client.js +0 -67
- package/dist/gRPC/ststest/src/greeter_client.js.map +0 -1
- package/dist/gRPC/ststest/src/greeter_server.js +0 -78
- package/dist/gRPC/ststest/src/greeter_server.js.map +0 -1
- package/dist/gRPC/ststest/src/route_guide_client.js +0 -258
- package/dist/gRPC/ststest/src/route_guide_client.js.map +0 -1
- package/dist/gRPC/ststest/src/route_guide_server.js +0 -237
- package/dist/gRPC/ststest/src/route_guide_server.js.map +0 -1
- package/dist/gRPC/ststest/src/route_guide_server2.js +0 -205
- package/dist/gRPC/ststest/src/route_guide_server2.js.map +0 -1
- package/dist/influxdb/influxDBManager.js +0 -304
- package/dist/influxdb/influxDBManager.js.map +0 -1
- package/dist/influxdb/influxDBManagerAgent.js +0 -14
- package/dist/influxdb/influxDBManagerAgent.js.map +0 -1
- package/dist/influxdb/influxDBManagerBase.js +0 -100
- package/dist/influxdb/influxDBManagerBase.js.map +0 -1
- package/dist/influxdb/influxDBManagerLambda.js +0 -17
- package/dist/influxdb/influxDBManagerLambda.js.map +0 -1
- package/dist/influxdb/influxDBManagerService.js +0 -14
- package/dist/influxdb/influxDBManagerService.js.map +0 -1
- package/dist/publishInstrumentsWebWorker.js +0 -159
- package/dist/publishInstrumentsWebWorker.js.map +0 -1
- package/dist/server.js.map +0 -1
- package/dist/socketIoServerHelper.js +0 -125
- package/dist/socketIoServerHelper.js.map +0 -1
- package/dist/tcpclient/app.js +0 -23
- package/dist/tcpclient/app.js.map +0 -1
- package/dist/tcpclient/app2.js +0 -57
- package/dist/tcpclient/app2.js.map +0 -1
- package/dist/tcpserver/app.js +0 -16
- package/dist/tcpserver/app.js.map +0 -1
- package/dist/tcpserver/appConfig.js +0 -83
- package/dist/tcpserver/appConfig.js.map +0 -1
- package/dist/tcpserver/appmaster.js +0 -446
- package/dist/tcpserver/appmaster.js.map +0 -1
- package/dist/testertesting/app.js +0 -284
- package/dist/testertesting/app.js.map +0 -1
- package/dist/testertesting/commonTypes.js +0 -47
- package/dist/testertesting/commonTypes.js.map +0 -1
- package/dist/testertesting/telemetryProcessor.js +0 -111
- package/dist/testertesting/telemetryProcessor.js.map +0 -1
- package/dist/testertesting/testCase01.js +0 -169
- package/dist/testertesting/testCase01.js.map +0 -1
- package/dist/testertesting/workerInstance.js +0 -263
- package/dist/testertesting/workerInstance.js.map +0 -1
- package/dist/testertesting/workerManager.js +0 -450
- package/dist/testertesting/workerManager.js.map +0 -1
- package/dist/testertesting/workerWorkerTestRunner01.js +0 -35
- package/dist/testertesting/workerWorkerTestRunner01.js.map +0 -1
- package/dist/testing/app.js +0 -18
- package/dist/testing/app.js.map +0 -1
- package/dist/testing/appConfig.js +0 -93
- package/dist/testing/appConfig.js.map +0 -1
- package/dist/testing/appTinyEmitter.js +0 -37
- package/dist/testing/appTinyEmitter.js.map +0 -1
- package/dist/testing/appWorkerWSS.js +0 -151
- package/dist/testing/appWorkerWSS.js.map +0 -1
- package/dist/testing/appredistest.js +0 -239
- package/dist/testing/appredistest.js.map +0 -1
- package/dist/testing/appsolo.js +0 -67
- package/dist/testing/appsolo.js.map +0 -1
- package/dist/testing/promiseTesting.js +0 -77
- package/dist/testing/promiseTesting.js.map +0 -1
- package/dist/testing/server.js +0 -15
- package/dist/testing/server.js.map +0 -1
- package/dist/testing/wsevents.js +0 -3
- package/dist/testing/wsevents.js.map +0 -1
- package/dist/webworkertesting/app.js +0 -44
- package/dist/webworkertesting/app.js.map +0 -1
- package/dist/webworkertesting/worker.js +0 -21
- package/dist/webworkertesting/worker.js.map +0 -1
- package/src/authDefs.ts +0 -37
- package/src/gRPC/ststest/protos/BUILD +0 -82
- package/src/gRPC/ststest/protos/README.md +0 -8
- package/src/gRPC/ststest/protos/auth_sample.proto +0 -42
- package/src/gRPC/ststest/protos/auth_sample.ts +0 -20
- package/src/gRPC/ststest/protos/echo.proto +0 -45
- package/src/gRPC/ststest/protos/echo.ts +0 -22
- package/src/gRPC/ststest/protos/grpc/examples/echo/Echo.ts +0 -55
- package/src/gRPC/ststest/protos/grpc/examples/echo/EchoRequest.ts +0 -10
- package/src/gRPC/ststest/protos/grpc/examples/echo/EchoResponse.ts +0 -10
- package/src/gRPC/ststest/protos/grpc/testing/Request.ts +0 -12
- package/src/gRPC/ststest/protos/grpc/testing/Response.ts +0 -12
- package/src/gRPC/ststest/protos/grpc/testing/TestService.ts +0 -27
- package/src/gRPC/ststest/protos/hellostreamingworld/HelloReply.ts +0 -10
- package/src/gRPC/ststest/protos/hellostreamingworld/HelloRequest.ts +0 -12
- package/src/gRPC/ststest/protos/hellostreamingworld/MultiGreeter.ts +0 -23
- package/src/gRPC/ststest/protos/hellostreamingworld.proto +0 -39
- package/src/gRPC/ststest/protos/hellostreamingworld.ts +0 -18
- package/src/gRPC/ststest/protos/helloworld/Greeter.ts +0 -35
- package/src/gRPC/ststest/protos/helloworld/HelloReply.ts +0 -10
- package/src/gRPC/ststest/protos/helloworld/HelloRequest.ts +0 -10
- package/src/gRPC/ststest/protos/helloworld.proto +0 -40
- package/src/gRPC/ststest/protos/helloworld.ts +0 -18
- package/src/gRPC/ststest/protos/keyvaluestore/KeyValueStore.ts +0 -23
- package/src/gRPC/ststest/protos/keyvaluestore/Request.ts +0 -10
- package/src/gRPC/ststest/protos/keyvaluestore/Response.ts +0 -10
- package/src/gRPC/ststest/protos/keyvaluestore.proto +0 -33
- package/src/gRPC/ststest/protos/keyvaluestore.ts +0 -18
- package/src/gRPC/ststest/protos/route_guide.proto +0 -111
- package/src/gRPC/ststest/protos/route_guide.ts +0 -21
- package/src/gRPC/ststest/protos/routeguide/Feature.ts +0 -13
- package/src/gRPC/ststest/protos/routeguide/Point.ts +0 -12
- package/src/gRPC/ststest/protos/routeguide/Rectangle.ts +0 -13
- package/src/gRPC/ststest/protos/routeguide/RouteGuide.ts +0 -58
- package/src/gRPC/ststest/protos/routeguide/RouteNote.ts +0 -13
- package/src/gRPC/ststest/protos/routeguide/RouteSummary.ts +0 -16
- package/src/gRPC/ststest/src/commonTypes.ts +0 -27
- package/src/gRPC/ststest/src/greeter_client.ts +0 -52
- package/src/gRPC/ststest/src/greeter_server.ts +0 -62
- package/src/gRPC/ststest/src/route_guide_client.ts +0 -266
- package/src/gRPC/ststest/src/route_guide_server.ts +0 -234
- package/src/gRPC/ststest/src/route_guide_server2.ts +0 -211
- package/src/influxdb/influxDBManager.ts +0 -334
- package/src/influxdb/influxDBManagerAgent.ts +0 -14
- package/src/influxdb/influxDBManagerBase.ts +0 -108
- package/src/influxdb/influxDBManagerLambda.ts +0 -17
- package/src/influxdb/influxDBManagerService.ts +0 -14
- package/src/publishInstrumentsWebWorker.ts +0 -157
- package/src/tcpclient/app.ts +0 -21
- package/src/tcpclient/app2.ts +0 -58
- package/src/tcpserver/app.ts +0 -11
- package/src/tcpserver/appConfig.ts +0 -99
- package/src/tcpserver/appmaster.ts +0 -503
- package/src/testertesting/app.ts +0 -349
- package/src/testertesting/commonTypes.ts +0 -236
- package/src/testertesting/telemetryProcessor.ts +0 -125
- package/src/testertesting/testCase01.ts +0 -207
- package/src/testertesting/workerInstance.ts +0 -297
- package/src/testertesting/workerManager.ts +0 -511
- package/src/testertesting/workerWorkerTestRunner01.ts +0 -34
- package/src/testing/app.ts +0 -14
- package/src/testing/appConfig.ts +0 -110
- package/src/testing/appTinyEmitter.ts +0 -57
- package/src/testing/appWorkerWSS.ts +0 -174
- package/src/testing/appredistest.ts +0 -304
- package/src/testing/appsolo.ts +0 -96
- package/src/testing/docker-compose.yml +0 -20
- package/src/testing/promiseTesting.ts +0 -86
- package/src/testing/server.ts +0 -17
- package/src/testing/wsevents.ts +0 -33
- package/src/webworkertesting/app.ts +0 -56
- package/src/webworkertesting/worker.ts +0 -24
- package/types/authDefs.d.ts +0 -29
- package/types/authDefs.d.ts.map +0 -1
- package/types/gRPC/ststest/protos/auth_sample.d.ts +0 -19
- package/types/gRPC/ststest/protos/auth_sample.d.ts.map +0 -1
- package/types/gRPC/ststest/protos/echo.d.ts +0 -21
- package/types/gRPC/ststest/protos/echo.d.ts.map +0 -1
- package/types/gRPC/ststest/protos/grpc/examples/echo/Echo.d.ts +0 -43
- package/types/gRPC/ststest/protos/grpc/examples/echo/Echo.d.ts.map +0 -1
- package/types/gRPC/ststest/protos/grpc/examples/echo/EchoRequest.d.ts +0 -7
- package/types/gRPC/ststest/protos/grpc/examples/echo/EchoRequest.d.ts.map +0 -1
- package/types/gRPC/ststest/protos/grpc/examples/echo/EchoResponse.d.ts +0 -7
- package/types/gRPC/ststest/protos/grpc/examples/echo/EchoResponse.d.ts.map +0 -1
- package/types/gRPC/ststest/protos/grpc/testing/Request.d.ts +0 -9
- package/types/gRPC/ststest/protos/grpc/testing/Request.d.ts.map +0 -1
- package/types/gRPC/ststest/protos/grpc/testing/Response.d.ts +0 -9
- package/types/gRPC/ststest/protos/grpc/testing/Response.d.ts.map +0 -1
- package/types/gRPC/ststest/protos/grpc/testing/TestService.d.ts +0 -21
- package/types/gRPC/ststest/protos/grpc/testing/TestService.d.ts.map +0 -1
- package/types/gRPC/ststest/protos/hellostreamingworld/HelloReply.d.ts +0 -7
- package/types/gRPC/ststest/protos/hellostreamingworld/HelloReply.d.ts.map +0 -1
- package/types/gRPC/ststest/protos/hellostreamingworld/HelloRequest.d.ts +0 -9
- package/types/gRPC/ststest/protos/hellostreamingworld/HelloRequest.d.ts.map +0 -1
- package/types/gRPC/ststest/protos/hellostreamingworld/MultiGreeter.d.ts +0 -17
- package/types/gRPC/ststest/protos/hellostreamingworld/MultiGreeter.d.ts.map +0 -1
- package/types/gRPC/ststest/protos/hellostreamingworld.d.ts +0 -17
- package/types/gRPC/ststest/protos/hellostreamingworld.d.ts.map +0 -1
- package/types/gRPC/ststest/protos/helloworld/Greeter.d.ts +0 -27
- package/types/gRPC/ststest/protos/helloworld/Greeter.d.ts.map +0 -1
- package/types/gRPC/ststest/protos/helloworld/HelloReply.d.ts +0 -7
- package/types/gRPC/ststest/protos/helloworld/HelloReply.d.ts.map +0 -1
- package/types/gRPC/ststest/protos/helloworld/HelloRequest.d.ts +0 -7
- package/types/gRPC/ststest/protos/helloworld/HelloRequest.d.ts.map +0 -1
- package/types/gRPC/ststest/protos/helloworld.d.ts +0 -17
- package/types/gRPC/ststest/protos/helloworld.d.ts.map +0 -1
- package/types/gRPC/ststest/protos/keyvaluestore/KeyValueStore.d.ts +0 -17
- package/types/gRPC/ststest/protos/keyvaluestore/KeyValueStore.d.ts.map +0 -1
- package/types/gRPC/ststest/protos/keyvaluestore/Request.d.ts +0 -7
- package/types/gRPC/ststest/protos/keyvaluestore/Request.d.ts.map +0 -1
- package/types/gRPC/ststest/protos/keyvaluestore/Response.d.ts +0 -7
- package/types/gRPC/ststest/protos/keyvaluestore/Response.d.ts.map +0 -1
- package/types/gRPC/ststest/protos/keyvaluestore.d.ts +0 -17
- package/types/gRPC/ststest/protos/keyvaluestore.d.ts.map +0 -1
- package/types/gRPC/ststest/protos/route_guide.d.ts +0 -20
- package/types/gRPC/ststest/protos/route_guide.d.ts.map +0 -1
- package/types/gRPC/ststest/protos/routeguide/Feature.d.ts +0 -10
- package/types/gRPC/ststest/protos/routeguide/Feature.d.ts.map +0 -1
- package/types/gRPC/ststest/protos/routeguide/Point.d.ts +0 -9
- package/types/gRPC/ststest/protos/routeguide/Point.d.ts.map +0 -1
- package/types/gRPC/ststest/protos/routeguide/Rectangle.d.ts +0 -10
- package/types/gRPC/ststest/protos/routeguide/Rectangle.d.ts.map +0 -1
- package/types/gRPC/ststest/protos/routeguide/RouteGuide.d.ts +0 -46
- package/types/gRPC/ststest/protos/routeguide/RouteGuide.d.ts.map +0 -1
- package/types/gRPC/ststest/protos/routeguide/RouteNote.d.ts +0 -10
- package/types/gRPC/ststest/protos/routeguide/RouteNote.d.ts.map +0 -1
- package/types/gRPC/ststest/protos/routeguide/RouteSummary.d.ts +0 -13
- package/types/gRPC/ststest/protos/routeguide/RouteSummary.d.ts.map +0 -1
- package/types/gRPC/ststest/src/commonTypes.d.ts +0 -23
- package/types/gRPC/ststest/src/commonTypes.d.ts.map +0 -1
- package/types/gRPC/ststest/src/greeter_client.d.ts +0 -3
- package/types/gRPC/ststest/src/greeter_client.d.ts.map +0 -1
- package/types/gRPC/ststest/src/greeter_server.d.ts +0 -3
- package/types/gRPC/ststest/src/greeter_server.d.ts.map +0 -1
- package/types/gRPC/ststest/src/route_guide_client.d.ts +0 -3
- package/types/gRPC/ststest/src/route_guide_client.d.ts.map +0 -1
- package/types/gRPC/ststest/src/route_guide_server.d.ts +0 -3
- package/types/gRPC/ststest/src/route_guide_server.d.ts.map +0 -1
- package/types/gRPC/ststest/src/route_guide_server2.d.ts +0 -3
- package/types/gRPC/ststest/src/route_guide_server2.d.ts.map +0 -1
- package/types/influxdb/influxDBManager.d.ts +0 -21
- package/types/influxdb/influxDBManager.d.ts.map +0 -1
- package/types/influxdb/influxDBManagerAgent.d.ts +0 -8
- package/types/influxdb/influxDBManagerAgent.d.ts.map +0 -1
- package/types/influxdb/influxDBManagerBase.d.ts +0 -14
- package/types/influxdb/influxDBManagerBase.d.ts.map +0 -1
- package/types/influxdb/influxDBManagerLambda.d.ts +0 -11
- package/types/influxdb/influxDBManagerLambda.d.ts.map +0 -1
- package/types/influxdb/influxDBManagerService.d.ts +0 -8
- package/types/influxdb/influxDBManagerService.d.ts.map +0 -1
- package/types/publishInstrumentsWebWorker.d.ts +0 -1
- package/types/publishInstrumentsWebWorker.d.ts.map +0 -1
- package/types/server.d.ts.map +0 -1
- package/types/socketIoServerHelper.d.ts +0 -20
- package/types/socketIoServerHelper.d.ts.map +0 -1
- package/types/tcpclient/app.d.ts +0 -2
- package/types/tcpclient/app.d.ts.map +0 -1
- package/types/tcpclient/app2.d.ts +0 -2
- package/types/tcpclient/app2.d.ts.map +0 -1
- package/types/tcpserver/app.d.ts +0 -2
- package/types/tcpserver/app.d.ts.map +0 -1
- package/types/tcpserver/appConfig.d.ts +0 -3
- package/types/tcpserver/appConfig.d.ts.map +0 -1
- package/types/tcpserver/appmaster.d.ts +0 -24
- package/types/tcpserver/appmaster.d.ts.map +0 -1
- package/types/testertesting/app.d.ts +0 -2
- package/types/testertesting/app.d.ts.map +0 -1
- package/types/testertesting/commonTypes.d.ts +0 -215
- package/types/testertesting/commonTypes.d.ts.map +0 -1
- package/types/testertesting/telemetryProcessor.d.ts +0 -6
- package/types/testertesting/telemetryProcessor.d.ts.map +0 -1
- package/types/testertesting/testCase01.d.ts +0 -20
- package/types/testertesting/testCase01.d.ts.map +0 -1
- package/types/testertesting/workerInstance.d.ts +0 -23
- package/types/testertesting/workerInstance.d.ts.map +0 -1
- package/types/testertesting/workerManager.d.ts +0 -16
- package/types/testertesting/workerManager.d.ts.map +0 -1
- package/types/testertesting/workerWorkerTestRunner01.d.ts +0 -7
- package/types/testertesting/workerWorkerTestRunner01.d.ts.map +0 -1
- package/types/testing/app.d.ts +0 -2
- package/types/testing/app.d.ts.map +0 -1
- package/types/testing/appConfig.d.ts +0 -3
- package/types/testing/appConfig.d.ts.map +0 -1
- package/types/testing/appTinyEmitter.d.ts +0 -2
- package/types/testing/appTinyEmitter.d.ts.map +0 -1
- package/types/testing/appWorkerWSS.d.ts +0 -26
- package/types/testing/appWorkerWSS.d.ts.map +0 -1
- package/types/testing/appredistest.d.ts +0 -4
- package/types/testing/appredistest.d.ts.map +0 -1
- package/types/testing/appsolo.d.ts +0 -3
- package/types/testing/appsolo.d.ts.map +0 -1
- package/types/testing/promiseTesting.d.ts +0 -4
- package/types/testing/promiseTesting.d.ts.map +0 -1
- package/types/testing/server.d.ts +0 -6
- package/types/testing/server.d.ts.map +0 -1
- package/types/testing/wsevents.d.ts +0 -18
- package/types/testing/wsevents.d.ts.map +0 -1
- package/types/webworkertesting/app.d.ts +0 -2
- package/types/webworkertesting/app.d.ts.map +0 -1
- package/types/webworkertesting/worker.d.ts +0 -2
- package/types/webworkertesting/worker.d.ts.map +0 -1
|
@@ -1,266 +0,0 @@
|
|
|
1
|
-
/* eslint @typescript-eslint/no-explicit-any: 0 */ // --> OFF
|
|
2
|
-
|
|
3
|
-
/*
|
|
4
|
-
*
|
|
5
|
-
* Copyright 2015 gRPC authors.
|
|
6
|
-
*
|
|
7
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
-
* you may not use this file except in compliance with the License.
|
|
9
|
-
* You may obtain a copy of the License at
|
|
10
|
-
*
|
|
11
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
-
*
|
|
13
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
-
* See the License for the specific language governing permissions and
|
|
17
|
-
* limitations under the License.
|
|
18
|
-
*
|
|
19
|
-
*/
|
|
20
|
-
|
|
21
|
-
const PROTO_PATH_CL = __dirname + './../../../../src/gRPC/ststest/protos/route_guide.proto';
|
|
22
|
-
|
|
23
|
-
import * as grpc from '@grpc/grpc-js';
|
|
24
|
-
import * as protoLoader from '@grpc/proto-loader';
|
|
25
|
-
|
|
26
|
-
import { IFeature, IPoint, IRectangle, IRouteNote, IRouteSummary } from './commonTypes'
|
|
27
|
-
|
|
28
|
-
import chalk from 'chalk'
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
const packageDefinition = protoLoader.loadSync(
|
|
32
|
-
PROTO_PATH_CL,
|
|
33
|
-
{keepCase: true,
|
|
34
|
-
longs: String,
|
|
35
|
-
enums: String,
|
|
36
|
-
defaults: true,
|
|
37
|
-
oneofs: true
|
|
38
|
-
});
|
|
39
|
-
const routeguide = grpc.loadPackageDefinition(packageDefinition).routeguide;
|
|
40
|
-
|
|
41
|
-
// Secure client
|
|
42
|
-
|
|
43
|
-
const client = new (routeguide as any).RouteGuide('stscore.stsmda.org:3029',
|
|
44
|
-
grpc.credentials.createSsl());
|
|
45
|
-
|
|
46
|
-
// Insecure client
|
|
47
|
-
/*
|
|
48
|
-
const client = new (routeguide as any).RouteGuide('stscore.stsmda.org:3029',
|
|
49
|
-
grpc.credentials.createInsecure());
|
|
50
|
-
*/
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* Run the getFeature demo. Calls getFeature with a point known to have a
|
|
54
|
-
* feature and a point known not to have a feature.
|
|
55
|
-
* @param {function} callback Called when this demo is complete
|
|
56
|
-
*/
|
|
57
|
-
const runGetFeature = async (): Promise<void> => {
|
|
58
|
-
return new Promise((resolve, reject) => {
|
|
59
|
-
console.log(chalk.grey(`runGetFeature: Starting ...`));
|
|
60
|
-
function featureCallback(error: any, feature: IFeature) {
|
|
61
|
-
if (error) {
|
|
62
|
-
reject(error);
|
|
63
|
-
return;
|
|
64
|
-
}
|
|
65
|
-
if (feature.name === '') {
|
|
66
|
-
console.log(chalk.grey('runGetFeature: Found no feature at ' +
|
|
67
|
-
feature.location.latitude + ', ' +
|
|
68
|
-
feature.location.longitude));
|
|
69
|
-
} else {
|
|
70
|
-
console.log(chalk.grey('runGetFeature: Found feature called "' + feature.name + '" at ' +
|
|
71
|
-
feature.location.latitude + ', ' +
|
|
72
|
-
feature.location.longitude));
|
|
73
|
-
}
|
|
74
|
-
console.log(chalk.grey(`runGetFeature: End`));
|
|
75
|
-
resolve();
|
|
76
|
-
}
|
|
77
|
-
const point1: IPoint = {
|
|
78
|
-
latitude: 1,
|
|
79
|
-
longitude: 2
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
client.getFeature(point1, featureCallback);
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* Run the listFeatures demo. Calls listFeatures with a rectangle containing all
|
|
88
|
-
* of the features in the pre-generated database. Prints each response as it
|
|
89
|
-
* comes in.
|
|
90
|
-
* @param {function} callback Called when this demo is complete
|
|
91
|
-
*/
|
|
92
|
-
const runListFeatures = async (): Promise<void> => {
|
|
93
|
-
return new Promise((resolve, reject) => {
|
|
94
|
-
console.log(chalk.green(`runListFeatures: Starting ...`));
|
|
95
|
-
|
|
96
|
-
// Setup timeout ...
|
|
97
|
-
const timeout = setTimeout(() => {
|
|
98
|
-
console.log(chalk.green(`runListFeatures: End in error state - timeout`));
|
|
99
|
-
reject('Timeout error ...');
|
|
100
|
-
}, 10000);
|
|
101
|
-
|
|
102
|
-
const rectangle: IRectangle = {
|
|
103
|
-
lo: {
|
|
104
|
-
latitude: 1,
|
|
105
|
-
longitude: 2
|
|
106
|
-
},
|
|
107
|
-
hi: {
|
|
108
|
-
latitude: 3,
|
|
109
|
-
longitude: 4
|
|
110
|
-
}
|
|
111
|
-
};
|
|
112
|
-
console.log(chalk.green('runListFeatures: Looking for features between 40, -75 and 42, -73'));
|
|
113
|
-
const call = client.listFeatures(rectangle);
|
|
114
|
-
call.on('data', function(feature: IFeature) {
|
|
115
|
-
console.log(chalk.green('runListFeatures: Found feature called "' + feature.name + '" at ' +
|
|
116
|
-
feature.location.latitude + ', ' +
|
|
117
|
-
feature.location.longitude));
|
|
118
|
-
});
|
|
119
|
-
call.on('end', () => {
|
|
120
|
-
console.log(chalk.green(`runListFeatures: End`));
|
|
121
|
-
clearTimeout(timeout);
|
|
122
|
-
resolve()
|
|
123
|
-
});
|
|
124
|
-
});
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
/**
|
|
128
|
-
* Run the recordRoute demo. Sends several randomly chosen points from the
|
|
129
|
-
* pre-generated feature database with a variable delay in between. Prints the
|
|
130
|
-
* statistics when they are sent from the server.
|
|
131
|
-
* @param {function} callback Called when this demo is complete
|
|
132
|
-
*/
|
|
133
|
-
const runRecordRoute = async (): Promise<void> => {
|
|
134
|
-
return new Promise((resolve, reject) => {
|
|
135
|
-
console.log(chalk.magenta(`runRecordRoute: Starting ...`));
|
|
136
|
-
const call = client.recordRoute(function(error: any, stats: IRouteSummary) {
|
|
137
|
-
if (error) {
|
|
138
|
-
console.log(chalk.magenta(`runRecordRoute: End (in error state): [${error}]`));
|
|
139
|
-
reject(error);
|
|
140
|
-
return;
|
|
141
|
-
}
|
|
142
|
-
console.log('Finished trip with', stats.point_count, 'points');
|
|
143
|
-
console.log('Passed', stats.feature_count, 'features');
|
|
144
|
-
console.log('Travelled', stats.distance, 'meters');
|
|
145
|
-
console.log('It took', stats.elapsed_time, 'seconds');
|
|
146
|
-
console.log(chalk.magenta(`runRecordRoute: End`));
|
|
147
|
-
resolve();
|
|
148
|
-
});
|
|
149
|
-
|
|
150
|
-
// Now stream data to the server
|
|
151
|
-
for (let i = 0; i < 10; i++) {
|
|
152
|
-
console.log(chalk.magenta(`runRecordRoute: Sending iteration: [${i}]`));
|
|
153
|
-
call.write({
|
|
154
|
-
latitude: i,
|
|
155
|
-
longitude: i*2
|
|
156
|
-
} as IPoint);
|
|
157
|
-
}
|
|
158
|
-
// now sleep some random delay ...
|
|
159
|
-
console.log(chalk.magenta(`runRecordRoute: Sending End`));
|
|
160
|
-
call.end();
|
|
161
|
-
});
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
/**
|
|
165
|
-
* Run the routeChat demo. Send some chat messages, and print any chat messages
|
|
166
|
-
* that are sent from the server.
|
|
167
|
-
* @param {function} callback Called when the demo is complete
|
|
168
|
-
*/
|
|
169
|
-
const runRouteChat = async (): Promise<void> => {
|
|
170
|
-
return new Promise((resolve, reject) => {
|
|
171
|
-
console.log(chalk.cyan(`runRouteChat: Starting ...`));
|
|
172
|
-
|
|
173
|
-
// Setup timeout ...
|
|
174
|
-
const timeout = setTimeout(() => {
|
|
175
|
-
console.log(chalk.cyan(`runRouteChat: End in error state - timeout`));
|
|
176
|
-
reject('Timeout error ...');
|
|
177
|
-
}, 10000);
|
|
178
|
-
|
|
179
|
-
const call = client.routeChat();
|
|
180
|
-
|
|
181
|
-
// Stream data from the server event
|
|
182
|
-
call.on('data', function(note: IRouteNote) {
|
|
183
|
-
console.log(chalk.cyan('Got message "' + note.message + '" at ' +
|
|
184
|
-
note.location.latitude + ', ' + note.location.longitude));
|
|
185
|
-
});
|
|
186
|
-
|
|
187
|
-
// When server completed, end is invoked
|
|
188
|
-
call.on('end', () => {
|
|
189
|
-
clearTimeout(timeout);
|
|
190
|
-
console.log(chalk.cyan(`runRouteChat: End`));
|
|
191
|
-
resolve();
|
|
192
|
-
});
|
|
193
|
-
|
|
194
|
-
// Now stream data to the server
|
|
195
|
-
const notes = [{
|
|
196
|
-
location: {
|
|
197
|
-
latitude: 1,
|
|
198
|
-
longitude: 2
|
|
199
|
-
},
|
|
200
|
-
message: 'First message'
|
|
201
|
-
}, {
|
|
202
|
-
location: {
|
|
203
|
-
latitude: 3,
|
|
204
|
-
longitude: 4
|
|
205
|
-
},
|
|
206
|
-
message: 'Second message'
|
|
207
|
-
}, {
|
|
208
|
-
location: {
|
|
209
|
-
latitude: 5,
|
|
210
|
-
longitude: 6
|
|
211
|
-
},
|
|
212
|
-
message: 'Third message'
|
|
213
|
-
}, {
|
|
214
|
-
location: {
|
|
215
|
-
latitude: 7,
|
|
216
|
-
longitude: 8
|
|
217
|
-
},
|
|
218
|
-
message: 'Fourth message'
|
|
219
|
-
}];
|
|
220
|
-
for (let i = 0; i < notes.length; i++) {
|
|
221
|
-
const note = notes[i];
|
|
222
|
-
console.log(chalk.cyan('Sending message "' + note.message + '" at ' +
|
|
223
|
-
note.location.latitude + ', ' + note.location.longitude));
|
|
224
|
-
call.write(note);
|
|
225
|
-
}
|
|
226
|
-
console.log(chalk.cyan(`Calling end`));
|
|
227
|
-
call.end();
|
|
228
|
-
});
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
/**
|
|
232
|
-
* Run all of the demos in order
|
|
233
|
-
*/
|
|
234
|
-
async function main() {
|
|
235
|
-
|
|
236
|
-
const start = performance.now();
|
|
237
|
-
|
|
238
|
-
const totalIterations = 5000;
|
|
239
|
-
for (let i=0; i < totalIterations; i++) {
|
|
240
|
-
|
|
241
|
-
const promArray: Promise<void>[] = [ ];
|
|
242
|
-
|
|
243
|
-
promArray.push(runGetFeature());
|
|
244
|
-
promArray.push(runListFeatures());
|
|
245
|
-
promArray.push(runRecordRoute());
|
|
246
|
-
promArray.push(runRouteChat());
|
|
247
|
-
|
|
248
|
-
await Promise.all(promArray);
|
|
249
|
-
console.log(i);
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
const end = performance.now();
|
|
253
|
-
|
|
254
|
-
console.log(`total time = ${end-start}`);
|
|
255
|
-
console.log(`iterations per second = ${(totalIterations / (end-start)) * 1000.0}`);
|
|
256
|
-
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
if (require.main === module) {
|
|
260
|
-
main();
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
exports.runGetFeature = runGetFeature;
|
|
264
|
-
exports.runListFeatures = runListFeatures;
|
|
265
|
-
exports.runRecordRoute = runRecordRoute;
|
|
266
|
-
exports.runRouteChat = runRouteChat;
|
|
@@ -1,234 +0,0 @@
|
|
|
1
|
-
/* eslint @typescript-eslint/no-explicit-any: 0 */ // --> OFF
|
|
2
|
-
|
|
3
|
-
/*
|
|
4
|
-
*
|
|
5
|
-
* Copyright 2015 gRPC authors.
|
|
6
|
-
*
|
|
7
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
-
* you may not use this file except in compliance with the License.
|
|
9
|
-
* You may obtain a copy of the License at
|
|
10
|
-
*
|
|
11
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
-
*
|
|
13
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
-
* See the License for the specific language governing permissions and
|
|
17
|
-
* limitations under the License.
|
|
18
|
-
*
|
|
19
|
-
*/
|
|
20
|
-
|
|
21
|
-
const PROTO_PATH_SV = __dirname + './../../../../src/gRPC/ststest/protos/route_guide.proto';
|
|
22
|
-
|
|
23
|
-
import * as grpc from '@grpc/grpc-js';
|
|
24
|
-
import * as protoLoader from '@grpc/proto-loader';
|
|
25
|
-
|
|
26
|
-
import { IFeature, IPoint, IRectangle, IRouteNote, IRouteSummary } from './commonTypes'
|
|
27
|
-
|
|
28
|
-
import chalk from 'chalk'
|
|
29
|
-
|
|
30
|
-
import fs from 'node:fs'
|
|
31
|
-
|
|
32
|
-
const packageDefinition = protoLoader.loadSync(
|
|
33
|
-
PROTO_PATH_SV,
|
|
34
|
-
{keepCase: true,
|
|
35
|
-
longs: String,
|
|
36
|
-
enums: String,
|
|
37
|
-
defaults: true,
|
|
38
|
-
oneofs: true
|
|
39
|
-
});
|
|
40
|
-
const routeguide = grpc.loadPackageDefinition(packageDefinition).routeguide;
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* Get a feature object at the given point, or creates one if it does not exist.
|
|
44
|
-
* @param {point} point The point to check
|
|
45
|
-
* @return {feature} The feature object at the point. Note that an empty name
|
|
46
|
-
* indicates no feature
|
|
47
|
-
*/
|
|
48
|
-
function checkFeature(point: IPoint): IFeature {
|
|
49
|
-
const feature: IFeature = {
|
|
50
|
-
name: "Some name",
|
|
51
|
-
location: {
|
|
52
|
-
latitude: point.latitude * 2,
|
|
53
|
-
longitude: point.longitude * 2
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
return feature;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* getFeature request handler. Gets a request with a point, and responds with a
|
|
61
|
-
* feature object indicating whether there is a feature at that point.
|
|
62
|
-
* @param {EventEmitter} call Call object for the handler to process
|
|
63
|
-
* @param {function(Error, feature)} callback Response callback
|
|
64
|
-
*/
|
|
65
|
-
function getFeature(call: any, callback: any) {
|
|
66
|
-
console.log(chalk.grey(`getFeature: call.request: [${JSON.stringify(call.request)}]`));
|
|
67
|
-
const retVal = checkFeature(call.request as IPoint);
|
|
68
|
-
console.log(chalk.grey(`getFeature: return: [${JSON.stringify(retVal)}]`));
|
|
69
|
-
callback(null, retVal);
|
|
70
|
-
/*
|
|
71
|
-
console.log(chalk.grey(`getFeature2: call.request: [${JSON.stringify(call.request)}]`));
|
|
72
|
-
const retVal: IFeature = checkFeature(call.request as IPoint);
|
|
73
|
-
|
|
74
|
-
console.log(chalk.grey(`getFeature: return value: [${JSON.stringify(retVal)}]`));
|
|
75
|
-
return retVal;
|
|
76
|
-
*/
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
* listFeatures request handler. Gets a request with two points, and responds
|
|
81
|
-
* with a stream of all features in the bounding box defined by those points.
|
|
82
|
-
* @param {Writable} call Writable stream for responses with an additional
|
|
83
|
-
* request property for the request value.
|
|
84
|
-
*/
|
|
85
|
-
function listFeatures(call: any) {
|
|
86
|
-
console.log(chalk.green(`listFeatures: forEach: [${JSON.stringify(call.request)}]`));
|
|
87
|
-
const rectangle = call.request as IRectangle;
|
|
88
|
-
const lo = rectangle.lo as IPoint;
|
|
89
|
-
const hi = rectangle.hi as IPoint;
|
|
90
|
-
|
|
91
|
-
const feature_list: IFeature[] = [ ];
|
|
92
|
-
for (let i=0; i < 10; i++) {
|
|
93
|
-
feature_list.push({
|
|
94
|
-
location: {
|
|
95
|
-
latitude: hi.latitude * 2 * (i+1),
|
|
96
|
-
longitude: lo.longitude * 2 * (i+1)
|
|
97
|
-
},
|
|
98
|
-
name: `the name for index: [${i}]`
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
feature_list.forEach((feature: IFeature) => {
|
|
102
|
-
console.log(chalk.green(`listFeatures: forEach: [${JSON.stringify(feature)}]`));
|
|
103
|
-
call.write(feature);
|
|
104
|
-
});
|
|
105
|
-
console.log(chalk.green(`listFeatures: call.end()`));
|
|
106
|
-
call.end();
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
/**
|
|
110
|
-
* recordRoute handler. Gets a stream of points, and responds with statistics
|
|
111
|
-
* about the "trip": number of points, number of known features visited, total
|
|
112
|
-
* distance traveled, and total time spent.
|
|
113
|
-
* @param {Readable} call The request point stream.
|
|
114
|
-
* @param {function(Error, routeSummary)} callback The callback to pass the
|
|
115
|
-
* response to
|
|
116
|
-
*/
|
|
117
|
-
function recordRoute(call: any, callback: any) {
|
|
118
|
-
let point_count = 0;
|
|
119
|
-
let feature_count = 0;
|
|
120
|
-
let distance = 0;
|
|
121
|
-
let previous: any = null;
|
|
122
|
-
// Start a timer
|
|
123
|
-
const start_time = process.hrtime();
|
|
124
|
-
call.on('data', function(point: IPoint) {
|
|
125
|
-
console.log(chalk.magenta(`recordRoute: on data: [${JSON.stringify(point)}]`));
|
|
126
|
-
point_count += 1;
|
|
127
|
-
if (checkFeature(point).name !== '') {
|
|
128
|
-
feature_count += 1;
|
|
129
|
-
}
|
|
130
|
-
/* For each point after the first, add the incremental distance from the
|
|
131
|
-
* previous point to the total distance value */
|
|
132
|
-
if (previous != null) {
|
|
133
|
-
distance += 1;
|
|
134
|
-
}
|
|
135
|
-
previous = point;
|
|
136
|
-
});
|
|
137
|
-
call.on('end', function() {
|
|
138
|
-
const returnData: IRouteSummary = {
|
|
139
|
-
point_count: point_count,
|
|
140
|
-
feature_count: feature_count,
|
|
141
|
-
// Cast the distance to an integer
|
|
142
|
-
distance: distance|0,
|
|
143
|
-
// End the timer
|
|
144
|
-
elapsed_time: process.hrtime(start_time)[0]
|
|
145
|
-
}
|
|
146
|
-
console.log(chalk.magenta(`recordRoute: on end - return data: [${JSON.stringify(returnData)}]`));
|
|
147
|
-
callback(null, returnData);
|
|
148
|
-
});
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
/**
|
|
152
|
-
* routeChat handler. Receives a stream of message/location pairs, and responds
|
|
153
|
-
* with a stream of all previous messages at each of those locations.
|
|
154
|
-
* @param {Duplex} call The stream for incoming and outgoing messages
|
|
155
|
-
*/
|
|
156
|
-
function routeChat(call: any) {
|
|
157
|
-
call.on('data', function(note: IRouteNote) {
|
|
158
|
-
console.log(chalk.cyan(`routeChat: on data: [${JSON.stringify(note)}]`));
|
|
159
|
-
// Send back what we just got
|
|
160
|
-
const sendBack: IRouteNote = JSON.parse(JSON.stringify(note));
|
|
161
|
-
sendBack.message = `${note.message} reply message`;
|
|
162
|
-
sendBack.location.latitude = note.location.latitude * 2;
|
|
163
|
-
sendBack.location.longitude = note.location.longitude * 2;
|
|
164
|
-
console.log(chalk.cyan(`routeChat: sending data: [${JSON.stringify(sendBack)}]`));
|
|
165
|
-
call.write(sendBack);
|
|
166
|
-
});
|
|
167
|
-
call.on('end', function() {
|
|
168
|
-
call.end();
|
|
169
|
-
});
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
/**
|
|
173
|
-
* Get a new server with the handler functions in this file bound to the methods
|
|
174
|
-
* it serves.
|
|
175
|
-
* @return {Server} The new server object
|
|
176
|
-
*/
|
|
177
|
-
function getServer() {
|
|
178
|
-
const server = new grpc.Server();
|
|
179
|
-
|
|
180
|
-
//server.addService(routeguide.routeguide.RouteGuide.service, exampleServer);
|
|
181
|
-
|
|
182
|
-
server.addService((routeguide as any).RouteGuide.service, {
|
|
183
|
-
getFeature: getFeature,
|
|
184
|
-
listFeatures: listFeatures,
|
|
185
|
-
recordRoute: recordRoute,
|
|
186
|
-
routeChat: routeChat
|
|
187
|
-
});
|
|
188
|
-
return server;
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
// HTTPS_SERVER_KEY_PATH=/etc/letsencrypt/live/stsmda.org/privkey.pem \
|
|
192
|
-
// HTTPS_SERVER_CERT_PATH=/etc/letsencrypt/live/stsmda.org/fullchain.pem \
|
|
193
|
-
|
|
194
|
-
/*
|
|
195
|
-
export interface KeyCertPair {
|
|
196
|
-
private_key: Buffer;
|
|
197
|
-
cert_chain: Buffer;
|
|
198
|
-
}
|
|
199
|
-
*/
|
|
200
|
-
|
|
201
|
-
if (require.main === module) {
|
|
202
|
-
// If this is run as a script, start a server on an unused port
|
|
203
|
-
const routeServer = getServer();
|
|
204
|
-
|
|
205
|
-
// Secure server
|
|
206
|
-
|
|
207
|
-
routeServer.bindAsync('0.0.0.0:3029', grpc.ServerCredentials.createSsl(null,
|
|
208
|
-
[
|
|
209
|
-
{
|
|
210
|
-
private_key: fs.readFileSync('/etc/letsencrypt/live/stsmda.org/privkey.pem'),
|
|
211
|
-
cert_chain: fs.readFileSync('/etc/letsencrypt/live/stsmda.org/fullchain.pem')
|
|
212
|
-
}
|
|
213
|
-
]), (error, port) => {
|
|
214
|
-
if (error) {
|
|
215
|
-
console.log(chalk.red(`Error starting gRPC TLS server on port: [${port}], Error: [${error}]`));
|
|
216
|
-
} else {
|
|
217
|
-
console.log(chalk.green(`Started gRPC TLS server on port: [${port}]`));
|
|
218
|
-
}
|
|
219
|
-
});
|
|
220
|
-
|
|
221
|
-
// Insecure server
|
|
222
|
-
/*
|
|
223
|
-
routeServer.bindAsync('0.0.0.0:3029', grpc.ServerCredentials.createInsecure(),
|
|
224
|
-
(error, port) => {
|
|
225
|
-
if (error) {
|
|
226
|
-
console.log(chalk.red(`Error starting gRPC TLS server on port: [${port}], Error: [${error}]`));
|
|
227
|
-
} else {
|
|
228
|
-
console.log(chalk.green(`Started gRPC TLS server on port: [${port}]`));
|
|
229
|
-
}
|
|
230
|
-
});
|
|
231
|
-
*/
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
exports.getServer = getServer;
|