@push-rpc/core
Advanced tools
Comparing version 1.0.31 to 1.0.32
@@ -1,4 +0,4 @@ | ||
import { DataConsumer, RemoteTopic, TopicImpl } from "./rpc"; | ||
import { DataConsumer, LocalTopic, RemoteTopic, TopicImpl } from "./rpc"; | ||
import { RpcSession } from "./RpcSession"; | ||
export declare class RemoteTopicImpl<D, F> extends TopicImpl implements RemoteTopic<D, F> { | ||
export declare class RemoteTopicImpl<D, F> extends TopicImpl implements RemoteTopic<D, F>, LocalTopic<D, F> { | ||
private topicName; | ||
@@ -15,3 +15,4 @@ private session; | ||
private cached; | ||
trigger(p?: F, data?: D): void; | ||
} | ||
export declare function createRemote(level: number, session: RpcSession): any; |
@@ -95,2 +95,4 @@ "use strict"; | ||
}; | ||
// this is only to easy using for remote services during tests | ||
RemoteTopicImpl.prototype.trigger = function (p, data) { }; | ||
return RemoteTopicImpl; | ||
@@ -97,0 +99,0 @@ }(rpc_1.TopicImpl)); |
@@ -157,3 +157,3 @@ "use strict"; | ||
if (this.lastMessageAt < now - this.keepAliveTimeout) { | ||
logger_1.log.debug("Keep alive period expired, closing ws"); | ||
logger_1.log.debug("Keep alive period expired, closing socket " + this.connectionContext.remoteId); | ||
this.terminate(); | ||
@@ -213,3 +213,3 @@ } | ||
catch (e) { | ||
logger_1.log.error("Failed to handle RPC message " + data + "\n", e); | ||
logger_1.log.error("Failed to handle RPC message " + data + "\n, remote id " + this.connectionContext.remoteId, e); | ||
} | ||
@@ -216,0 +216,0 @@ }; |
@@ -80,5 +80,5 @@ "use strict"; | ||
clientLevel: 0, | ||
pingSendTimeout: 50 * 1000, | ||
keepAliveTimeout: 25 * 1000, | ||
callTimeout: 30 * 1000, | ||
pingSendTimeout: 40 * 1000, | ||
keepAliveTimeout: 120 * 1000, | ||
callTimeout: 15 * 1000, | ||
syncRemoteCalls: false, | ||
@@ -85,0 +85,0 @@ messageParser: function (data) { return JSON.parse(data, utils_1.dateReviver); }, |
{ | ||
"name": "@push-rpc/core", | ||
"version": "1.0.31", | ||
"version": "1.0.32", | ||
"main": "dist/index.js", | ||
@@ -5,0 +5,0 @@ "types": "dist/index.d.ts", |
@@ -1,2 +0,3 @@ | ||
import {DataConsumer, MessageType, Method, RemoteTopic, TopicImpl} from "./rpc" | ||
import {LocalTopicImpl} from "./local" | ||
import {DataConsumer, LocalTopic, MessageType, Method, RemoteTopic, TopicImpl} from "./rpc" | ||
import {createMessageId, getClassMethodNames} from "./utils" | ||
@@ -10,3 +11,4 @@ import {RpcSession} from "./RpcSession" | ||
export class RemoteTopicImpl<D, F> extends TopicImpl implements RemoteTopic<D, F> { | ||
export class RemoteTopicImpl<D, F> extends TopicImpl | ||
implements RemoteTopic<D, F>, LocalTopic<D, F> { | ||
constructor(private topicName: string, private session: RpcSession) { | ||
@@ -92,2 +94,5 @@ super() | ||
private cached: {[paramsKey: string]: D} = {} | ||
// this is only to easy using for remote services during tests | ||
trigger(p?: F, data?: D): void {} | ||
} | ||
@@ -94,0 +99,0 @@ |
@@ -123,3 +123,3 @@ import {log} from "./logger" | ||
if (this.lastMessageAt < now - this.keepAliveTimeout) { | ||
log.debug("Keep alive period expired, closing ws") | ||
log.debug(`Keep alive period expired, closing socket ${this.connectionContext.remoteId}`) | ||
this.terminate() | ||
@@ -199,3 +199,6 @@ } | ||
} catch (e) { | ||
log.error(`Failed to handle RPC message ${data}\n`, e) | ||
log.error( | ||
`Failed to handle RPC message ${data}\n, remote id ${this.connectionContext.remoteId}`, | ||
e | ||
) | ||
} | ||
@@ -202,0 +205,0 @@ } |
@@ -38,5 +38,5 @@ import * as UUID from "uuid-js" | ||
clientLevel: 0, | ||
pingSendTimeout: 50 * 1000, | ||
keepAliveTimeout: 25 * 1000, | ||
callTimeout: 30 * 1000, | ||
pingSendTimeout: 40 * 1000, | ||
keepAliveTimeout: 120 * 1000, | ||
callTimeout: 15 * 1000, | ||
syncRemoteCalls: false, | ||
@@ -43,0 +43,0 @@ messageParser: data => JSON.parse(data, dateReviver), |
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
118679
3182