Replies: 3 comments 5 replies
-
To be honest, I don't think it will be added, at least not for exports. Appending data to a sheet, has proven to be less performant than hoped; each queue job increases in memory and time because unfortunately it will have to reload all data in memory; it's not like csv which just can append new data to the end of the stream. Things will change in next releases around queuing bigger exports. However for imports it might be a possibility in the future. I've havent given it any thoughts yet, but I think it will suite that feature pretty well. |
Beta Was this translation helpful? Give feedback.
-
I think this makes more sense for importing, because the current method runs each job one at a time (chained) With batching, we could have the same after job triggers /etc, but concurrent processing of chunks. What do you think @patrickbrouwers |
Beta Was this translation helpful? Give feedback.
-
Hey @patrickbrouwers If you let us know about your ideas (if you already made some thoughts) we're ready to support here. |
Beta Was this translation helpful? Give feedback.
-
The current queueing process that laravel-excel has works great, especially with FromQuery and being able to export large amounts of data with chunking. The handling of failed exports works really well too.
With Laravel 8 came
Bus::batch()
feature, so it would be nice if the queue was able to be added onto a batch with other jobs like so:My use case for this is during exporting FromQuery chunks I use laravel-excel for xlsx and TCPDF wrapped in a laravel-actions AsJob in order to handle pdfs in a queue. I would like to replace the batch parameter with either xlsx or pdf based on the request so that the above code is written once. The work around right now is to have the above for pdfs, then this for xlsx (which again, all works great):
Doing some playing around it seems like the
Maatwebsite\Excel\Jobs\QueueExport
class would need theIlluminate\Bus\Batchable
trait added, which allows it to run on the batch properly, but if there is a failure it just keeps running theMaatwebsite\Excel\Jobs\AppendQueryToSheet
as many times as the retries is set rather than cancelling the batch.So it then seems like there should be a check somewhere to cancel and/or check to see if the batch has been cancelled.
That was the extent of what I was able to test out so far.
Thoughts?
Beta Was this translation helpful? Give feedback.
All reactions