batch/queue api what we can learn from drupal 7 for civicrm 4.1
TRANSCRIPT
![Page 1: Batch/Queue API What we can learn from Drupal 7 for CiviCRM 4.1](https://reader035.vdocuments.us/reader035/viewer/2022062417/551c5947550346a5458b5120/html5/thumbnails/1.jpg)
Batch/Queue APIWhat we can learn from Drupal 7 for CiviCRM 4.1
![Page 2: Batch/Queue API What we can learn from Drupal 7 for CiviCRM 4.1](https://reader035.vdocuments.us/reader035/viewer/2022062417/551c5947550346a5458b5120/html5/thumbnails/2.jpg)
About myselfChang Xiao
Emotive LLC
IRC: changx
Forum handle: xcf33
![Page 3: Batch/Queue API What we can learn from Drupal 7 for CiviCRM 4.1](https://reader035.vdocuments.us/reader035/viewer/2022062417/551c5947550346a5458b5120/html5/thumbnails/3.jpg)
Batch. Yum….A Batch of cookies
![Page 4: Batch/Queue API What we can learn from Drupal 7 for CiviCRM 4.1](https://reader035.vdocuments.us/reader035/viewer/2022062417/551c5947550346a5458b5120/html5/thumbnails/4.jpg)
Characteristics of BatchWorks on right after the series of action desired
to be performed is submitted.
Provide feedbacks to user on completion status.
Example: 3 records imported, etc
etc
Submit import form Import user 1
Import user 2
Import user 3
![Page 5: Batch/Queue API What we can learn from Drupal 7 for CiviCRM 4.1](https://reader035.vdocuments.us/reader035/viewer/2022062417/551c5947550346a5458b5120/html5/thumbnails/5.jpg)
BenefitsProvide user feed back on the progress.
(Usually user take it for granted).
Good and smooth user experience.
Preventing user errors.
![Page 6: Batch/Queue API What we can learn from Drupal 7 for CiviCRM 4.1](https://reader035.vdocuments.us/reader035/viewer/2022062417/551c5947550346a5458b5120/html5/thumbnails/6.jpg)
Potential PitfallsWaiting, Waiting and Waiting.
PHP settings (timeout, memory, etc)
Database settings (MySQL has gone away)
Conclusion:Not suitable for large scale operations.
![Page 7: Batch/Queue API What we can learn from Drupal 7 for CiviCRM 4.1](https://reader035.vdocuments.us/reader035/viewer/2022062417/551c5947550346a5458b5120/html5/thumbnails/7.jpg)
Queue, errrA line on Black Friday
![Page 8: Batch/Queue API What we can learn from Drupal 7 for CiviCRM 4.1](https://reader035.vdocuments.us/reader035/viewer/2022062417/551c5947550346a5458b5120/html5/thumbnails/8.jpg)
Characteristics of QueueFirst in First out (FIFO)
Processes a series of tasks in sequence
Example:
3 records imported,
etc etc
Submit import form
Imp
ort
user1 im
port
user2 im
port
user3
Import Queue
![Page 9: Batch/Queue API What we can learn from Drupal 7 for CiviCRM 4.1](https://reader035.vdocuments.us/reader035/viewer/2022062417/551c5947550346a5458b5120/html5/thumbnails/9.jpg)
BenefitsCan be stopped and resumed at any time.
Provides granular scalability and robustness.
Separate user input and actual process
![Page 10: Batch/Queue API What we can learn from Drupal 7 for CiviCRM 4.1](https://reader035.vdocuments.us/reader035/viewer/2022062417/551c5947550346a5458b5120/html5/thumbnails/10.jpg)
Potential PitfallsComplex design
Resource consumption
![Page 11: Batch/Queue API What we can learn from Drupal 7 for CiviCRM 4.1](https://reader035.vdocuments.us/reader035/viewer/2022062417/551c5947550346a5458b5120/html5/thumbnails/11.jpg)
Current CiviCRM applicationsBulk mailing
Each mailing is in a queue. Each mailing contains X number of emails and sits
in a mailing queue
Contact Import
ETC
![Page 12: Batch/Queue API What we can learn from Drupal 7 for CiviCRM 4.1](https://reader035.vdocuments.us/reader035/viewer/2022062417/551c5947550346a5458b5120/html5/thumbnails/12.jpg)
When to use?Batch:
Tasks that will exceed php time out Tasks with tolerable time frame (i.e. 5 minutes) Tasks that needs to provide continuous feedback
Queue: Tasks that takes a lot of time Tasks that can be stopped and resumed Distribute processing.
![Page 13: Batch/Queue API What we can learn from Drupal 7 for CiviCRM 4.1](https://reader035.vdocuments.us/reader035/viewer/2022062417/551c5947550346a5458b5120/html5/thumbnails/13.jpg)
Where to use itExporting contacts
Importing process
Running large reports
CiviMail bulk mailing process
Dedupe processes
Synchronizing processes
Installation/Upgrade
![Page 14: Batch/Queue API What we can learn from Drupal 7 for CiviCRM 4.1](https://reader035.vdocuments.us/reader035/viewer/2022062417/551c5947550346a5458b5120/html5/thumbnails/14.jpg)
Conclusion Batch Queue
![Page 15: Batch/Queue API What we can learn from Drupal 7 for CiviCRM 4.1](https://reader035.vdocuments.us/reader035/viewer/2022062417/551c5947550346a5458b5120/html5/thumbnails/15.jpg)
Why notHave your cookie and ….Eat it too?