#NEWLINE# def setupWriterProcessor( root_service , settings ) : #NEWLINE# #INDENT# from carbon import cache #NEWLINE# from carbon.protocols import CacheManagementHandler #NEWLINE# from carbon.writer import WriterService #NEWLINE# from carbon import events #NEWLINE# factory = ServerFactory ( ) #NEWLINE# factory . protocol = CacheManagementHandler #NEWLINE# service = TCPServer ( settings . CACHE_QUERY_PORT , factory , interface = settings . CACHE_QUERY_INTERFACE ) #NEWLINE# service . setServiceParent ( settings ) #NEWLINE# writer_service = WriterService ( ) #NEWLINE# writer_service . setServiceParent ( root_service ) #NEWLINE# if settings . USE_FLOW_CONTROL : #NEWLINE# #INDENT# events . cacheFull . addHandler ( events . pauseReceivingMetrics ) #NEWLINE# events . cacheSpaceAvailable . addHandler ( events . resumeReceivingMetrics )