コード例 #1
0
ファイル: stream.py プロジェクト: rogopag/attractions
class StreamTask(Task):
	
	sm = None #StreamManager class instance
	th = None #Threading class instace
	action = None
	
	def __init__(self):
		pass
		
	def run(self, coords, **kwargs):
		try:
			# This is not debug is required to check keys on 'stop'
			self.action = coords['stop']
			print "StreamTask ::: command from client is::: %s" % coords['stop']
			try:
				self.th = self.sm.stream(coords, obj = self.th)
			except AttributeError, e:
				print "StreamTask ::: no Threading instance retry %s" % e
				self.retry(args = [coords], exc=e, countdown=5, kwargs=kwargs)
		except KeyError, e:				
			print "StreamTask ::: Stream instantiated, for exception %s" % e
			self.sm = StreamManage(coords['bounds_id'])
			self.th = self.sm.stream(coords)
		print "From sample.task  Task is %s" % self.request.id + " the returned result from script called is %s" % self.th + " instance of StreamingManager class is %s" % self.sm
		return 'task executed'
コード例 #2
0
ファイル: stream.py プロジェクト: rogopag/attractions_rel
	def run(self, coords, **kwargs):
		try:
			print "StreamTask ::: Stream already instantiated, %s" % coords['stop']
			try:
				self.th = self.sm.stream(coords, obj = self.th)
			except AttributeError, e:
				print "StreamTask ::: the asshole is not an instance %s" % e
				self.retry(args = [coords], exc=e, countdown=30, kwargs=kwargs)
		except KeyError, e:				
			print "StreamTask ::: Stream instantiated, for exception %s" % e
			self.sm = StreamManage()
			self.th = self.sm.stream(coords)
コード例 #3
0
ファイル: stream.py プロジェクト: rogopag/attractions
	def run(self, coords, **kwargs):
		try:
			# This is not debug is required to check keys on 'stop'
			self.action = coords['stop']
			print "StreamTask ::: command from client is::: %s" % coords['stop']
			try:
				self.th = self.sm.stream(coords, obj = self.th)
			except AttributeError, e:
				print "StreamTask ::: no Threading instance retry %s" % e
				self.retry(args = [coords], exc=e, countdown=5, kwargs=kwargs)
		except KeyError, e:				
			print "StreamTask ::: Stream instantiated, for exception %s" % e
			self.sm = StreamManage(coords['bounds_id'])
			self.th = self.sm.stream(coords)
コード例 #4
0
ファイル: stream.py プロジェクト: rogopag/attractions_rel
class StreamTask(Task):
	
	sm = None
	th = None
	
	def __init__(self):
		pass
		
	def run(self, coords, **kwargs):
		try:
			print "StreamTask ::: Stream already instantiated, %s" % coords['stop']
			try:
				self.th = self.sm.stream(coords, obj = self.th)
			except AttributeError, e:
				print "StreamTask ::: the asshole is not an instance %s" % e
				self.retry(args = [coords], exc=e, countdown=30, kwargs=kwargs)
		except KeyError, e:				
			print "StreamTask ::: Stream instantiated, for exception %s" % e
			self.sm = StreamManage()
			self.th = self.sm.stream(coords)
		print "From sample.task  Task is %s" % self.request.id + " the returned result from script called is %s" % self.th + " instance of Straming is %s" % self.sm
		return 'task executed'