コード例 #1
0
    def startService(self):
        from message_processor import PyGoWaveMessageProcessor
        self.mp = PyGoWaveMessageProcessor()

        self.lc = LoopingCall(self.mp.purge_connections)
        self.lc2 = LoopingCall(self.mp.log_stats)
        self.lc.start(10 * 60)  # Purge every 10 minutes
        self.lc2.start(60 * 60, now=False)  # Stats every 60 minutes

        log.msg("=> PyGoWave Server service ready <=")
コード例 #2
0
ファイル: allPythonContent.py プロジェクト: Mondego/pyreco
	def startService(self):
		from message_processor import PyGoWaveMessageProcessor
		self.mp = PyGoWaveMessageProcessor()
		
		self.lc = LoopingCall(self.mp.purge_connections)
		self.lc2 = LoopingCall(self.mp.log_stats)
		self.lc.start(10 * 60) # Purge every 10 minutes
		self.lc2.start(60 * 60, now=False) # Stats every 60 minutes
		
		log.msg("=> PyGoWave Server service ready <=")
コード例 #3
0
class PyGoWaveService(Service):
    """
	Main service for PyGoWave, which processes incoming messages.
	
	"""

    implements(IPyGoWaveService)

    def factoryReady(self, factory):
        log.msg("=> PyGoWave Server factory ready <=")

    def messageQueueInfo(self):
        return [
            {
                "queue_name": "wavelet_server_singlethread",
                "exchange": "wavelet.topic",
                "routing_key": "*.*.clientop",
                "exchange_type": "topic",
            },
            {
                "queue_name": "wavelet_server_singlethread",
                "exchange": "federation.topic",
                "routing_key": "*.*.fedinop",
                "exchange_type": "topic",
            },
        ]

    def startService(self):
        from message_processor import PyGoWaveMessageProcessor
        self.mp = PyGoWaveMessageProcessor()

        self.lc = LoopingCall(self.mp.purge_connections)
        self.lc2 = LoopingCall(self.mp.log_stats)
        self.lc.start(10 * 60)  # Purge every 10 minutes
        self.lc2.start(60 * 60, now=False)  # Stats every 60 minutes

        log.msg("=> PyGoWave Server service ready <=")

    def stopService(self):
        if self.lc.running:
            self.lc.stop()
        if self.lc2.running:
            self.lc2.stop()

        self.lc = None
        self.lc2 = None
        self.mp = None

    def process(self, rkey, message_data):
        return self.mp.process(rkey, message_data)
コード例 #4
0
ファイル: allPythonContent.py プロジェクト: Mondego/pyreco
class PyGoWaveService(Service):
	"""
	Main service for PyGoWave, which processes incoming messages.
	
	"""
	
	implements(IPyGoWaveService)
	
	def factoryReady(self, factory):
		log.msg("=> PyGoWave Server factory ready <=")
	
	def messageQueueInfo(self):
		return [
			{
				"queue_name": "wavelet_server_singlethread",
				"exchange": "wavelet.topic",
				"routing_key": "*.*.clientop",
				"exchange_type": "topic",
			},
			{
				"queue_name": "wavelet_server_singlethread",
				"exchange": "federation.topic",
				"routing_key": "*.*.fedinop",
				"exchange_type": "topic",
			},
		]
	
	def startService(self):
		from message_processor import PyGoWaveMessageProcessor
		self.mp = PyGoWaveMessageProcessor()
		
		self.lc = LoopingCall(self.mp.purge_connections)
		self.lc2 = LoopingCall(self.mp.log_stats)
		self.lc.start(10 * 60) # Purge every 10 minutes
		self.lc2.start(60 * 60, now=False) # Stats every 60 minutes
		
		log.msg("=> PyGoWave Server service ready <=")
	
	def stopService(self):
		if self.lc.running:
			self.lc.stop()
		if self.lc2.running:
			self.lc2.stop()
		
		self.lc = None
		self.lc2 = None
		self.mp = None
	
	def process(self, rkey, message_data):
		return self.mp.process(rkey, message_data)