const SCBroker = require ( 'socketcluster/scbroker' ) ; const scClusterBrokerClient = require ( 'scc-broker-client' ) ; const scRedis = require ( 'sc-redis' ) ; export class Broker extends SCBroker { run ( ) { console . log ( '   >> Broker PID:' , process . pid ) ; if ( this . options . clusterStateServerHost ) { scClusterBrokerClient . attach ( this , { stateServerHost : this . options . clusterStateServerHost , stateServerPort : this . options . clusterStateServerPort , mappingEngine : this . options . clusterMappingEngine , clientPoolSize : this . options . clusterClientPoolSize , authKey : this . options . clusterAuthKey , stateServerConnectTimeout : this . options . clusterStateServerConnectTimeout , stateServerAckTimeout : this . options . clusterStateServerAckTimeout , stateServerReconnectRandomness : this . options . clusterStateServerReconnectRandomness } ) ; } if ( this . options . brokerOptions && this . options . brokerOptions . host ) { scRedis . attach ( this ) ; } } } const broker = new Broker ( ) ;