I have a use case which requires me to process a large list of data on an ad hoc basis.
If I just trigger a method to loop through the list, it is certain to cause an execution timeout even tgough I have purchased multiple execution time extensions. I estimate that the list takes about 10 minutes to process so this would not be advisable.
The simple strategy would be to set a timer to gradually process the list. However, since this use case just requires a 10 minute workload approximately once per week, the timer would be running empty the rest of the time.
The other option I have though of is to bulk create entries in a database table with the unique id’s of the list and then swr an after create event handler that will process each object in the list. My assumption is that each trigger of the event handler would run in parallel and not sequentially thus avoiding the execution timeout.
Is this second option okay to use? Is there another strategy you would advise? Is there a way to activate a timer only as long as a certain list is not empty or something like that?
But just checking, the option of generated parallel event handler triggers is not recommended because it creates peak activity? Or is there another reason?
Yes it could be so. Also it may slowdown the work with your table.
I thought about your problem as a bulk processing and try to solve it the most efficient way.
It may be convenient to store the data into some temporary table beforehand.
Is it possible to activate/stop a timer via API?
It is a pity, but for now it can be done only through the web-console.
That is why i recommend to use a cron type timers.