Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enqueue export on demande #134

Open
Grafikart opened this issue Jan 12, 2022 · 1 comment
Open

Enqueue export on demande #134

Grafikart opened this issue Jan 12, 2022 · 1 comment

Comments

@Grafikart
Copy link

With the current version it's possible to enqueue action implementing the ShouldQueue interface. But in some case it could be nice to be able to enqueue only if the action is heavy (for instance exporting one row is not queued, but exporting more than 100 rows will be enqueued).

Proposition

A new interface CouldQueue could be used in the Maatwebsite\Excel to choose if the action should be enqueued or not depending on the request or the models.

        if (
            $export instanceof ShouldQueue ||
            ($export instanceof CouldQueue && $export->shouldQueue($request, $models)
        ) {
            return $this->queue($export, $filePath, $diskName, $writerType, $diskOptions);
        }
@patrickbrouwers
Copy link
Member

I think it's best to implement this logic yourself as it most likely will entail more logic that what the package can offer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants