#NEWLINE# def tryToStartRelayProcess( self , relayScript ) : #NEWLINE# #INDENT# env = dict ( os . environ ) #NEWLINE# env [ 'NODE_ENV' ] = 'test' #NEWLINE# hasStartedEvent = threading . Event ( ) #NEWLINE# def onStdOut( msg ) : #NEWLINE# #INDENT# hasStartedEvent . set ( ) #NEWLINE# logging . critical ( 'RELAY STDOUT> %s' , msg ) #NEWLINE# #UNINDENT# def onStdErr( msg ) : #NEWLINE# #INDENT# logging . critical ( 'RELAY STDERR> %s' , msg ) #NEWLINE# #UNINDENT# coffeeCommand = './run_coffee.sh' #NEWLINE# if ( 'UFORA_DEBUG_RELAY' in os . environ ) : #NEWLINE# #INDENT# coffeeCommand = 'coffee-debug' #NEWLINE# #UNINDENT# nodejsOptions = [ ] #NEWLINE# if ( 'UFORA_PROFILE_RELAY' in os . environ ) : #NEWLINE# #INDENT# nodejsOptions = [ '--nodejs' , '--prof' ] #NEWLINE# #UNINDENT# args = [ relayScript , '--port' , str ( self . relayPort ) , '--gatewayport' , str ( hasStartedEvent . subscribableWebObjectsPort ) ] #NEWLINE# command = ( ( [ 'forever' , '-f' , '-l' , self . relayLogFile , '--workingDir' , self . webPath , 'start' , '-c' , coffeeCommand ] + nodejsOptions ) + args ) #NEWLINE# SubprocessRunner . SubprocessRunner ( command , onStdOut , onStdErr , env ) . start ( ) #NEWLINE# return hasStartedEvent