#NEWLINE# def __init__( self , callbackScheduler , cachePathOverride = None , port = None ) : #NEWLINE# #INDENT# self . callbackScheduler = callbackScheduler #NEWLINE# port = Setup . config ( ) . sharedStatePort #NEWLINE# logging . info ( 'Initializing SharedStateService with port = %s' , port ) #NEWLINE# self . cachePath = ( cachePathOverride if ( cachePathOverride is not None ) else Setup . config ( ) . sharedStateCache ) #NEWLINE# if ( ( self . cachePath != '' ) and ( not os . path . exists ( self . cachePath ) ) ) : #NEWLINE# #INDENT# os . makedirs ( self . cachePath ) #NEWLINE# #UNINDENT# CloudService . Service . __init__ ( self ) #NEWLINE# self . socketServer = SimpleServer . SimpleServer ( port ) #NEWLINE# self . keyspaceManager = KeyspaceManager ( 0 , 1 , pingInterval = 120 , cachePathOverride = cachePathOverride ) #NEWLINE# self . socketServer . _onConnect = self . onConnect #NEWLINE# self . socketServerThread = ManagedThread . ManagedThread ( target = self . socketServer . start ) #NEWLINE# self . logfilePruneThread = ManagedThread . ManagedThread ( target = self . logFilePruner ) #NEWLINE# self . stoppedFlag = threading . Event ( )