2

I am looking to queue my form submissions to be processed in the background.

I want to be able to only keep user data in the system/database as long as required. This will mean keeping it to debug it if something goes wrong in the processing (SMTP error to send the email, store in database/google sheet, etc)

As a bonus I figure queuing should mean faster success responses to users (rather than waiting for whatever processing is required), and can also throttle the processing if a form gets hit with lots of submissions in a short period (such as a competition).

Looking for clarification if:
1. Using the Craft Job queues is best for this.
2. If should just use the default queue, or better to have a separate queue

4
  • Keep in mind Jobs are only executed when someone enters the CP, as long as there is no valid CP user nothing will happen, that's why handling form submits in Jobs is not a good thing for fronend requests May 21, 2018 at 12:51
  • I was planning to setup a cronjob handle processing the queue more reliably.
    – sanscheese
    May 21, 2018 at 13:13
  • Then you can as well handle your requests via Cronjob from the beginning... I don't see any reason for a Craft Queue in that case. Queues are only "faster" because the function App::maxPowerCaptain() is executed before.. You can do that in your Cronjob as well May 21, 2018 at 13:17
  • Reason was thinking the queue to act a temporary storage. Being faster would be confirming the successful submission as soon as data received, compared to say after data is received, sent by email with SMTP and saved to a Google Sheet. So I could setup my own table to hold the data, and then process by a cron, but I was thinking it seemed to be following what a queue already does.
    – sanscheese
    May 21, 2018 at 13:37

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.