@push-rpc/core
Advanced tools
Comparing version 1.0.28 to 1.0.29
@@ -12,2 +12,6 @@ import { Middleware, RpcConnectionContext } from "./rpc"; | ||
syncRemoteCalls?: boolean; | ||
getKeepAliveSettings?(connectionContext: RpcConnectionContext): { | ||
pingSendTimeout: number; | ||
pongWaitTimeout: number; | ||
}; | ||
listeners?: { | ||
@@ -14,0 +18,0 @@ connected?(remoteId: string, connections: number): void; |
@@ -116,3 +116,3 @@ "use strict"; | ||
return __awaiter(_this, void 0, void 0, function () { | ||
var connectionContext, e_1, remoteId, session; | ||
var connectionContext, e_1, remoteId, keepAliveSettings, session; | ||
var _this = this; | ||
@@ -134,2 +134,5 @@ return __generator(this, function (_a) { | ||
remoteId = connectionContext.remoteId; | ||
keepAliveSettings = opts.getKeepAliveSettings | ||
? opts.getKeepAliveSettings(connectionContext) | ||
: { pingSendTimeout: opts.pingSendTimeout, pongWaitTimeout: opts.pongWaitTimeout }; | ||
session = new RpcSession_1.RpcSession(local, opts.clientLevel, { | ||
@@ -140,3 +143,3 @@ messageIn: function (data) { return opts.listeners.messageIn(remoteId, data); }, | ||
unsubscribed: function () { return opts.listeners.unsubscribed(getTotalSubscriptions()); }, | ||
}, connectionContext, opts.localMiddleware, opts.remoteMiddleware, opts.messageParser, opts.pingSendTimeout, opts.pongWaitTimeout, opts.syncRemoteCalls); | ||
}, connectionContext, opts.localMiddleware, opts.remoteMiddleware, opts.messageParser, keepAliveSettings.pingSendTimeout, keepAliveSettings.pongWaitTimeout, opts.syncRemoteCalls); | ||
session.open(socket); | ||
@@ -143,0 +146,0 @@ if (sessions[remoteId]) { |
{ | ||
"name": "@push-rpc/core", | ||
"version": "1.0.28", | ||
"version": "1.0.29", | ||
"main": "dist/index.js", | ||
@@ -5,0 +5,0 @@ "types": "dist/index.d.ts", |
@@ -20,2 +20,6 @@ import * as UUID from "uuid-js" | ||
getKeepAliveSettings?( | ||
connectionContext: RpcConnectionContext | ||
): {pingSendTimeout: number; pongWaitTimeout: number} | ||
listeners?: { | ||
@@ -100,2 +104,6 @@ connected?(remoteId: string, connections: number): void | ||
const keepAliveSettings = opts.getKeepAliveSettings | ||
? opts.getKeepAliveSettings(connectionContext) | ||
: {pingSendTimeout: opts.pingSendTimeout, pongWaitTimeout: opts.pongWaitTimeout} | ||
const session = new RpcSession( | ||
@@ -114,4 +122,4 @@ local, | ||
opts.messageParser, | ||
opts.pingSendTimeout, | ||
opts.pongWaitTimeout, | ||
keepAliveSettings.pingSendTimeout, | ||
keepAliveSettings.pongWaitTimeout, | ||
opts.syncRemoteCalls | ||
@@ -118,0 +126,0 @@ ) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
117094
3119