def on_start(self): #pragma no cover #-------------------------------------------------------------------------------- # Explicit on_start #-------------------------------------------------------------------------------- # Skip TransformStreamListener and go to StreamProcess to avoid the subscriber being created # We want explicit management of the thread and subscriber object for ingestion TransformStreamProcess.on_start(self) self.queue_name = self.CFG.get_safe('process.queue_name',self.id) self.subscriber = StreamSubscriber(process=self, exchange_name=self.queue_name, callback=self.receive_callback) self.thread_lock = RLock() #-------------------------------------------------------------------------------- # Normal on_start after this point #-------------------------------------------------------------------------------- BaseIngestionWorker.on_start(self) self._rpc_server = self.container.proc_manager._create_listening_endpoint(from_name=self.id, process=self) self.add_endpoint(self._rpc_server) self.event_publisher = EventPublisher(OT.DatasetModified) self.stored_value_manager = StoredValueManager(self.container) self.lookup_docs = self.CFG.get_safe('process.lookup_docs',[]) self.input_product = self.CFG.get_safe('process.input_product','') self.new_lookups = Queue() self.lookup_monitor = EventSubscriber(event_type=OT.ExternalReferencesUpdatedEvent, callback=self._add_lookups, auto_delete=True) self.add_endpoint(self.lookup_monitor) self.connection_id = '' self.connection_index = None self.start_listener()
def on_start(self): #pragma no cover #super(TransformWorker,self).on_start() #-------------------------------------------------------------------------------- # Explicit on_start #-------------------------------------------------------------------------------- # Skip TransformStreamListener and go to StreamProcess to avoid the subscriber being created # We want explicit management of the thread and subscriber object for ingestion #todo: check how to manage multi queue subscription (transform scenario 3) TransformStreamProcess.on_start(self) #todo: can the subscription be changed or updated when new dataprocesses are added ? self.queue_name = self.CFG.get_safe('process.queue_name',self.id) self.subscriber = StreamSubscriber(process=self, exchange_name=self.queue_name, callback=self.receive_callback) self.thread_lock = RLock() self._rpc_server = self.container.proc_manager._create_listening_endpoint(from_name=self.id, process=self) self.add_endpoint(self._rpc_server) self.start_listener() #todo: determine and publish appropriate set of status events self.event_publisher = EventPublisher(OT.DataProcessStatusEvent) url = 'http://sddevrepo.oceanobservatories.org/releases/ion_example-0.1-py2.7.egg' filepath = self.download_egg(url) print filepath import pkg_resources pkg_resources.working_set.add_entry('ion_example-0.1-py2.7.egg') from ion_example.add_arrays import add_arrays
def on_start(self): #pragma no cover #super(TransformWorker,self).on_start() #-------------------------------------------------------------------------------- # Explicit on_start #-------------------------------------------------------------------------------- # Skip TransformStreamListener and go to StreamProcess to avoid the subscriber being created # We want explicit management of the thread and subscriber object for ingestion #todo: check how to manage multi queue subscription (transform scenario 3) TransformStreamProcess.on_start(self) #todo: can the subscription be changed or updated when new dataprocesses are added ? self.queue_name = self.CFG.get_safe('process.queue_name', self.id) self.subscriber = StreamSubscriber(process=self, exchange_name=self.queue_name, callback=self.receive_callback) self.thread_lock = RLock() self._rpc_server = self.container.proc_manager._create_listening_endpoint( from_name=self.id, process=self) self.add_endpoint(self._rpc_server) self.start_listener() #todo: determine and publish appropriate set of status events self.event_publisher = EventPublisher(OT.DataProcessStatusEvent)
def on_start(self): #pragma no cover #super(TransformWorker,self).on_start() #-------------------------------------------------------------------------------- # Explicit on_start #-------------------------------------------------------------------------------- # Skip TransformStreamListener and go to StreamProcess to avoid the subscriber being created # We want explicit management of the thread and subscriber object for ingestion #todo: check how to manage multi queue subscription (transform scenario 3) TransformStreamProcess.on_start(self) #todo: can the subscription be changed or updated when new dataprocesses are added ? self.queue_name = self.CFG.get_safe('process.queue_name',self.id) self.subscriber = StreamSubscriber(process=self, exchange_name=self.queue_name, callback=self.receive_callback) self.thread_lock = RLock() self._rpc_server = self.container.proc_manager._create_listening_endpoint(from_name=self.id, process=self) self.add_endpoint(self._rpc_server) self.start_listener() #todo: determine and publish appropriate set of status events self.event_publisher = EventPublisher(OT.DataProcessStatusEvent)