node-universe
Version:
基于 Nodejs 环境的一款微服务框架,原理来自于宇宙中的恒星,行星,卫星等系统。
27 lines (26 loc) • 717 B
TypeScript
import { GenericObject } from '../../typings';
export default class Node {
id: string;
instanceID: string | null;
available: boolean;
local: boolean;
lastHeartbeatTime: number;
config: GenericObject;
client: GenericObject;
metadata: any;
ipList: any;
port: number | null;
hostname: string | null;
udpAddress: string | null;
rawInfo: any;
services: Array<any>;
cpu: any;
cpuSeq: any;
seq: number;
offlineSince: any;
constructor(id: string);
update(payload: GenericObject, isReconnected: boolean): true | undefined;
updateLocalInfo(cpuUsage: any): Promise<any>;
heartbeat(payload: GenericObject): void;
disconnected(): void;
}