teraslice icon indicating copy to clipboard operation
teraslice copied to clipboard

Operation APIs are not available in the constructor of operations

Open kstaken opened this issue 5 years ago • 1 comments

Calling this.getAPI() in the constructor of an operation in the pipeline will fail while calling it in the process function succeeds. The API is registered on the job so it seems like it should be available by the time the operations are instantiated.

kstaken avatar Jan 31 '20 23:01 kstaken

After consulting with Peter, we are not sure that it is feasible/appropriate to have getApi available during the constructor phase of an operation. Some of the setup of the api's may be async, which we cannot do properly in the constructor phase. We would not be able to guarantee that all necessary api's, especially any api's made by other processors/fetchers would work. In our other processors we usually do this kind of setup in the initialize method of the operation.

jsnoble avatar Feb 18 '20 18:02 jsnoble

Not a major concern.

kstaken avatar Oct 07 '24 19:10 kstaken