Skip to content

Commit 52a034c

Browse files
committed
start segmenter in the corresponding hook method
1 parent 6e80cf8 commit 52a034c

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

pvapy/hpc/dataProcessingController.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def createDataPublisher(self, pvObject):
7474
configDict = {}
7575
if self.outputArgs:
7676
configDict = json.loads(self.outputArgs)
77-
return EjfatDataPublisher(outputChannel=self.outputChannel, configDict=configDict)
77+
self.dataPublisher = EjfatDataPublisher(outputChannel=self.outputChannel, configDict=configDict)
7878
else:
7979
raise pva.InvalidState(f'Unsupported output mode: {self.outputMode}')
8080
if self.userDataProcessor:

pvapy/hpc/ejfatDataPublisher.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,17 @@ def __init__(self, outputChannel, configDict={}):
4646

4747
self.logger.debug('Creating segmenter')
4848
self.segmenter = e2sar_py.DataPlane.Segmenter(self.ejfatUri, self.dataId, self.eventSourceId, sflags)
49-
self.logger.debug('Starting segmenter')
50-
self.segmenter.OpenAndStart()
5149
except Exception as ex:
5250
raise pva.ConfigurationError(f'Cannot initialize EJFAT data publisher: {ex}')
5351
self.logger.debug('Created EJFAT data publisher')
5452

53+
def start(self):
54+
try:
55+
self.logger.debug('Starting segmenter')
56+
self.segmenter.OpenAndStart()
57+
except Exception as ex:
58+
raise pva.ConfigurationError(f'Cannot start EJFAT data publisher: {ex}')
59+
5560
def updateOutputChannel(self, pvObject):
5661
try:
5762
buffer = pickle.dumps(pvObject)

0 commit comments

Comments
 (0)