-
Notifications
You must be signed in to change notification settings - Fork 144
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
Attachment queueing? #96
Comments
There's no support for queueing in the current package. Gosh I would love to have it though. I've scratched a few ideas around about how to do this, but I haven't implemented anything as of yet. |
I'd also be interested in this |
I'm hitting this problem now more often since I'm converting my images into 5 different versions on the fly and I allow users to upload 20 or so files at once. This results in very slow performance when waiting for the resize and then the upload to S3, sometimes even hitting the max_execution_time. How would you go about this? |
I've not done multiple files, but the way I've handled this is basically the following:
It's basically queuing outside of Stapler instead of inside. |
I made a rough version of Stapler with queueing that I'm using in a project. Most of the queueing stuff is done in laravel-stapler. I would like to share and explain my code if you're interested. |
I would be interested, still something on my todo list for one of our products that uses stapler intensively. |
Ok, this is what I'm working on right now. staplerdefer & defer_all_except options$this->hasAttachedFile('picture', [
'styles' => [/* your styles */],
'defer' => [/* styles you don't want to process immediately */],
'defer_all_except' => [/* opposite of 'defer' option */]
]); reprocess specific styles$attachment->reprocess($styles = []); process deferred stylesStill have to add a method to process only the deferred styles. Will use the reprocess method. laravel-staplerProcessDeferredAttachmentStyles JobThis job processes the deferred attachment styles. QueueingEloquentTraitQueueingEloquentTrait will automatically dispatch the ProcessDeferredAttachmentStyles when needed. Let me know what you think. |
@jorenvanhee have you managed to get your queuing solution working? |
@tomvo Yep, got it working. I'm using my own forks now. But I would be happy to clean it up, document it, and submit a PR (if there's interest). Here's my fork of stapler and laravel-stapler. The word queue was already used in the codebase, so I used "defer". You'll see it in my commits. |
@jorenvanhee I checked your code and it actually looks pretty solid. The changes are actually not even that big. However it's Laravel 5 only. Unfortunately my legacy codebase is based on L4 so I wouldn't be able to help you out right away with testing it. I could adapt it to L4 though. |
I'm working on a 2.0 release of Stapler that's php7 and laravel 5.1 only. It's got some new features:
I'm going to release one more minor release from the 1x branch and back port as much of this stuff as possible to, but after that It's going to be bug fixes only for that branch. I'd really like to figure out a clean way to do attachment queueing that (works nicely/elegantly with this package) and get that into the new release for sure. I took a look at that code and it looks pretty clean, but there will more than likely have to be changes/tweaks to make it work consistently with the rest of the package. If you guys want to work on something bounce ideas around I think we could get it done. |
Great that you're working on v2 of the library. I guess it wouldn't make much sense for the package to add queuing support for L4. @jorenvanhee if you don't mind i'm going to use your |
@tomvo Great, go ahead! |
Is queueing built into the attachment processing? A case study in mind:
I'm not sure if anything like this exists in the current package. Thanks for any insight.
The text was updated successfully, but these errors were encountered: