fix(core): update

This commit is contained in:
2019-11-03 19:17:26 +01:00
parent 08c1618ea8
commit 3f073ab9b3
5 changed files with 30 additions and 8 deletions

View File

@ -16,6 +16,10 @@ export interface ISmartsocketConstructorOptions {
}
export class Smartsocket {
/**
* a unique id to detect server restarts
*/
public id = plugins.smartunique.shortId();
public options: ISmartsocketConstructorOptions;
public io: SocketIO.Server;
public socketConnections = new Objectmap<SocketConnection>();
@ -80,7 +84,7 @@ export class Smartsocket {
funcName: functionNameArg
},
originSocketConnection: targetSocketConnectionArg,
shortId: plugins.shortid.generate(),
shortId: plugins.smartunique.shortId(),
side: 'requesting'
});
const response: ISocketFunctionCallDataResponse<T> = await socketRequest.dispatch();

View File

@ -111,7 +111,7 @@ export class SmartsocketClient {
const socketRequest = new SocketRequest<T>(this, {
side: 'requesting',
originSocketConnection: this.socketConnection,
shortId: plugins.shortid.generate(),
shortId: plugins.smartunique.shortId(),
funcCallData: {
funcName: functionNameArg,
funcDataArg: dataArg

View File

@ -10,6 +10,7 @@ import * as smarthash from '@pushrocks/smarthash';
import * as smartdelay from '@pushrocks/smartdelay';
import * as smartexpress from '@pushrocks/smartexpress';
import * as smartpromise from '@pushrocks/smartpromise';
import * as smartunique from '@pushrocks/smartunique';
export {
@ -18,16 +19,15 @@ export {
smarthash,
smartdelay,
smartexpress,
smartpromise
smartpromise,
smartunique,
};
// third party scope
import * as shortid from 'shortid';
import socketIo from 'socket.io';
import socketIoClient from 'socket.io-client';
export {
shortid,
socketIo,
socketIoClient
};