SlideShare a Scribd company logo
1 of 21
Batch API
 Dániel Kalmár
 March 28, 2013
What is batch API?
What is batch API?

●   Batch (execution of a series of “jobs”)
●   Application Programming Interface
●   Avoid PHP timeout
●   Spread out the processing over several page
    requests
●   Feedback for users (progress bar)
●   Cannot use in cron jobs
When can batch API be useful?

●   designed to integrate with the Form API
    workflow
●   can be used by non-Form API scripts (update,
    page callbacks)
●   site install (module install)
●   bulk operations (nodes, users)
●   search API (indexing)
Functions

●   batch_get()
●   batch_process()
●   batch_set()
●   hook_batch_alter()
●   _batch_populate_queue()
●   _batch_queue()
How does it work?
Configuration
Process
●   set batch operation



●   execute batch operation (only need outside of a
    form submit handler)
Operations

●   $context
●   Set the starting values
Operations


●   update the values in each steps
Operations


●   check if all the steps have been executed
Operations
“Finished” callback
Cron queue
What is cron queue?


●   cron
●   hooks
●   queue API
●   limit the processing time of a queue per cron
    run
When can cron queue be useful?

●   processing large amounts of data in cron
●   bulk operations (nodes, users)
●   regular newsletter sending
How does it work?
Define a queue
●   Implement hook_cron_queue_info()
Load the queue
●   Loading items in the queue in hook_cron()
Process a queue item
●   worker callback deals with the individual queue
    items
Questions?

More Related Content

What's hot

SciPipe - A light-weight workflow library inspired by flow-based programming
SciPipe - A light-weight workflow library inspired by flow-based programmingSciPipe - A light-weight workflow library inspired by flow-based programming
SciPipe - A light-weight workflow library inspired by flow-based programmingSamuel Lampa
 
Dockerfile for rust project
Dockerfile for rust projectDockerfile for rust project
Dockerfile for rust projectHien Nguyen
 
Types - slice, map, new, make, struct - Gopherlabs
Types - slice, map, new, make, struct - Gopherlabs Types - slice, map, new, make, struct - Gopherlabs
Types - slice, map, new, make, struct - Gopherlabs sangam biradar
 
Alfresco勉強会#40 QRコードによる文書の振り分け
Alfresco勉強会#40 QRコードによる文書の振り分けAlfresco勉強会#40 QRコードによる文書の振り分け
Alfresco勉強会#40 QRコードによる文書の振り分けTakeshi Totani
 
What's new in WorkManager-Andri Suranta Ginting (Product Engineer-Gojek)
What's new in WorkManager-Andri Suranta Ginting (Product Engineer-Gojek)What's new in WorkManager-Andri Suranta Ginting (Product Engineer-Gojek)
What's new in WorkManager-Andri Suranta Ginting (Product Engineer-Gojek)DicodingEvent
 
Multitenant SaaS Apps In Rails By Iqbal Hasnan
Multitenant SaaS Apps In Rails By Iqbal HasnanMultitenant SaaS Apps In Rails By Iqbal Hasnan
Multitenant SaaS Apps In Rails By Iqbal Hasnaniqbal hasnan
 
Ansible Israel Kickoff Meetup
Ansible Israel Kickoff MeetupAnsible Israel Kickoff Meetup
Ansible Israel Kickoff Meetupansibleil
 
Trailblazer Rails Architecture
Trailblazer Rails ArchitectureTrailblazer Rails Architecture
Trailblazer Rails Architectureiqbal hasnan
 
Introducing CentOS container pipeline
Introducing CentOS container pipelineIntroducing CentOS container pipeline
Introducing CentOS container pipelineDharmit Shah
 
Ansistrano, or using Ansible for application deployments
Ansistrano, or using Ansible for application deploymentsAnsistrano, or using Ansible for application deployments
Ansistrano, or using Ansible for application deploymentsRoger Tanner
 
Continuous delivery@LesFurets - DC Continuous delivery meetup
Continuous delivery@LesFurets - DC Continuous delivery meetupContinuous delivery@LesFurets - DC Continuous delivery meetup
Continuous delivery@LesFurets - DC Continuous delivery meetupRaphaël Brugier
 
Introduction to Jhipster
Introduction to JhipsterIntroduction to Jhipster
Introduction to JhipsterKnoldus Inc.
 
[JCConf 2017] Reactive Programming with Reactor
[JCConf 2017] Reactive Programming with Reactor[JCConf 2017] Reactive Programming with Reactor
[JCConf 2017] Reactive Programming with ReactorSwanky Hsiao
 

What's hot (20)

SciPipe - A light-weight workflow library inspired by flow-based programming
SciPipe - A light-weight workflow library inspired by flow-based programmingSciPipe - A light-weight workflow library inspired by flow-based programming
SciPipe - A light-weight workflow library inspired by flow-based programming
 
Dockerfile for rust project
Dockerfile for rust projectDockerfile for rust project
Dockerfile for rust project
 
Types - slice, map, new, make, struct - Gopherlabs
Types - slice, map, new, make, struct - Gopherlabs Types - slice, map, new, make, struct - Gopherlabs
Types - slice, map, new, make, struct - Gopherlabs
 
Apache Airflow overview
Apache Airflow overviewApache Airflow overview
Apache Airflow overview
 
Alfresco勉強会#40 QRコードによる文書の振り分け
Alfresco勉強会#40 QRコードによる文書の振り分けAlfresco勉強会#40 QRコードによる文書の振り分け
Alfresco勉強会#40 QRコードによる文書の振り分け
 
What's new in WorkManager-Andri Suranta Ginting (Product Engineer-Gojek)
What's new in WorkManager-Andri Suranta Ginting (Product Engineer-Gojek)What's new in WorkManager-Andri Suranta Ginting (Product Engineer-Gojek)
What's new in WorkManager-Andri Suranta Ginting (Product Engineer-Gojek)
 
Multitenant SaaS Apps In Rails By Iqbal Hasnan
Multitenant SaaS Apps In Rails By Iqbal HasnanMultitenant SaaS Apps In Rails By Iqbal Hasnan
Multitenant SaaS Apps In Rails By Iqbal Hasnan
 
Advanced guide to Quartz plugin
Advanced guide to Quartz pluginAdvanced guide to Quartz plugin
Advanced guide to Quartz plugin
 
MLBlock
MLBlockMLBlock
MLBlock
 
React meets o OCalm
React meets o OCalmReact meets o OCalm
React meets o OCalm
 
Ansible Israel Kickoff Meetup
Ansible Israel Kickoff MeetupAnsible Israel Kickoff Meetup
Ansible Israel Kickoff Meetup
 
Trailblazer Rails Architecture
Trailblazer Rails ArchitectureTrailblazer Rails Architecture
Trailblazer Rails Architecture
 
Introducing CentOS container pipeline
Introducing CentOS container pipelineIntroducing CentOS container pipeline
Introducing CentOS container pipeline
 
js-why-it-is-better
js-why-it-is-betterjs-why-it-is-better
js-why-it-is-better
 
Ansistrano, or using Ansible for application deployments
Ansistrano, or using Ansible for application deploymentsAnsistrano, or using Ansible for application deployments
Ansistrano, or using Ansible for application deployments
 
Apache Airflow
Apache AirflowApache Airflow
Apache Airflow
 
Continuous delivery@LesFurets - DC Continuous delivery meetup
Continuous delivery@LesFurets - DC Continuous delivery meetupContinuous delivery@LesFurets - DC Continuous delivery meetup
Continuous delivery@LesFurets - DC Continuous delivery meetup
 
Overlay HPC Information
Overlay HPC InformationOverlay HPC Information
Overlay HPC Information
 
Introduction to Jhipster
Introduction to JhipsterIntroduction to Jhipster
Introduction to Jhipster
 
[JCConf 2017] Reactive Programming with Reactor
[JCConf 2017] Reactive Programming with Reactor[JCConf 2017] Reactive Programming with Reactor
[JCConf 2017] Reactive Programming with Reactor
 

Viewers also liked

Extend your REST API
Extend your REST APIExtend your REST API
Extend your REST APIAlexey Tokar
 
Case Study: API Recovery Process
Case Study: API Recovery ProcessCase Study: API Recovery Process
Case Study: API Recovery ProcessFlex Process
 
Deviations management in the context of ICH Q9 Q10
Deviations management in the context of ICH Q9 Q10Deviations management in the context of ICH Q9 Q10
Deviations management in the context of ICH Q9 Q10Alicia Tébar
 
Treat Your API Like a Product
Treat Your API Like a ProductTreat Your API Like a Product
Treat Your API Like a ProductElie Chevignard
 
Process Validation of API
Process Validation of APIProcess Validation of API
Process Validation of APIsrirao3462
 
upstream & downstream process of antibiotics
upstream & downstream process of antibioticsupstream & downstream process of antibiotics
upstream & downstream process of antibioticsAnil Kollur
 
Best Practices You Must Apply to Secure Your APIs - Scott Morrison, SVP & Dis...
Best Practices You Must Apply to Secure Your APIs - Scott Morrison, SVP & Dis...Best Practices You Must Apply to Secure Your APIs - Scott Morrison, SVP & Dis...
Best Practices You Must Apply to Secure Your APIs - Scott Morrison, SVP & Dis...CA API Management
 

Viewers also liked (9)

Extend your REST API
Extend your REST APIExtend your REST API
Extend your REST API
 
Case Study: API Recovery Process
Case Study: API Recovery ProcessCase Study: API Recovery Process
Case Study: API Recovery Process
 
4 trending gmp-issues_eng
4 trending gmp-issues_eng4 trending gmp-issues_eng
4 trending gmp-issues_eng
 
Deviations management in the context of ICH Q9 Q10
Deviations management in the context of ICH Q9 Q10Deviations management in the context of ICH Q9 Q10
Deviations management in the context of ICH Q9 Q10
 
Treat Your API Like a Product
Treat Your API Like a ProductTreat Your API Like a Product
Treat Your API Like a Product
 
Process Validation of API
Process Validation of APIProcess Validation of API
Process Validation of API
 
upstream & downstream process of antibiotics
upstream & downstream process of antibioticsupstream & downstream process of antibiotics
upstream & downstream process of antibiotics
 
PROCESS VALIDATION
PROCESS VALIDATIONPROCESS VALIDATION
PROCESS VALIDATION
 
Best Practices You Must Apply to Secure Your APIs - Scott Morrison, SVP & Dis...
Best Practices You Must Apply to Secure Your APIs - Scott Morrison, SVP & Dis...Best Practices You Must Apply to Secure Your APIs - Scott Morrison, SVP & Dis...
Best Practices You Must Apply to Secure Your APIs - Scott Morrison, SVP & Dis...
 

Similar to Drupal course - batch API

Design & Develop Batch Applications in Java/JEE
Design & Develop Batch Applications in Java/JEEDesign & Develop Batch Applications in Java/JEE
Design & Develop Batch Applications in Java/JEENaresh Chintalcheru
 
Apache Airflow in Production
Apache Airflow in ProductionApache Airflow in Production
Apache Airflow in ProductionRobert Sanders
 
Faster Drupal sites using Queue API
Faster Drupal sites using Queue APIFaster Drupal sites using Queue API
Faster Drupal sites using Queue APIOSInet
 
Delayed operations with queues for website performance
Delayed operations with queues for website performanceDelayed operations with queues for website performance
Delayed operations with queues for website performanceOSInet
 
Website Monitoring with Distributed Messages/Tasks Processing (AMQP & RabbitM...
Website Monitoring with Distributed Messages/Tasks Processing (AMQP & RabbitM...Website Monitoring with Distributed Messages/Tasks Processing (AMQP & RabbitM...
Website Monitoring with Distributed Messages/Tasks Processing (AMQP & RabbitM...Jimmy DeadcOde
 
Maintaining spatial data infrastructures (SDIs) using distributed task queues
Maintaining spatial data infrastructures (SDIs) using distributed task queuesMaintaining spatial data infrastructures (SDIs) using distributed task queues
Maintaining spatial data infrastructures (SDIs) using distributed task queuesPaolo Corti
 
Write an API for Almost Anything: The Amazing Power and Flexibility of Django...
Write an API for Almost Anything: The Amazing Power and Flexibility of Django...Write an API for Almost Anything: The Amazing Power and Flexibility of Django...
Write an API for Almost Anything: The Amazing Power and Flexibility of Django...Caktus Group
 
Introduction to Python Celery
Introduction to Python CeleryIntroduction to Python Celery
Introduction to Python CeleryMahendra M
 
Write an API for Almost Anything: The Amazing Power and Flexibility of Django...
Write an API for Almost Anything: The Amazing Power and Flexibility of Django...Write an API for Almost Anything: The Amazing Power and Flexibility of Django...
Write an API for Almost Anything: The Amazing Power and Flexibility of Django...Caktus Group
 
AthenaX - Unified Stream & Batch Processing using SQL at Uber, Zhenqiu Huang,...
AthenaX - Unified Stream & Batch Processing using SQL at Uber, Zhenqiu Huang,...AthenaX - Unified Stream & Batch Processing using SQL at Uber, Zhenqiu Huang,...
AthenaX - Unified Stream & Batch Processing using SQL at Uber, Zhenqiu Huang,...Bowen Li
 
LuaNode: Asynchronous I/O for Lua
LuaNode: Asynchronous I/O for LuaLuaNode: Asynchronous I/O for Lua
LuaNode: Asynchronous I/O for LuaIgnacio Burgueño
 
New features in Java 9: Modularity & Process handling
New features in Java 9: Modularity & Process handlingNew features in Java 9: Modularity & Process handling
New features in Java 9: Modularity & Process handlingKnoldus Inc.
 
Node js
Node jsNode js
Node jshazzaz
 
Java 9 has these new features!
Java 9 has these new features!Java 9 has these new features!
Java 9 has these new features!Knoldus Inc.
 

Similar to Drupal course - batch API (20)

Design & Develop Batch Applications in Java/JEE
Design & Develop Batch Applications in Java/JEEDesign & Develop Batch Applications in Java/JEE
Design & Develop Batch Applications in Java/JEE
 
Apache Airflow in Production
Apache Airflow in ProductionApache Airflow in Production
Apache Airflow in Production
 
Faster Drupal sites using Queue API
Faster Drupal sites using Queue APIFaster Drupal sites using Queue API
Faster Drupal sites using Queue API
 
Delayed operations with queues for website performance
Delayed operations with queues for website performanceDelayed operations with queues for website performance
Delayed operations with queues for website performance
 
Sprint 78
Sprint 78Sprint 78
Sprint 78
 
Website Monitoring with Distributed Messages/Tasks Processing (AMQP & RabbitM...
Website Monitoring with Distributed Messages/Tasks Processing (AMQP & RabbitM...Website Monitoring with Distributed Messages/Tasks Processing (AMQP & RabbitM...
Website Monitoring with Distributed Messages/Tasks Processing (AMQP & RabbitM...
 
Sprint 59
Sprint 59Sprint 59
Sprint 59
 
Sprint 61
Sprint 61Sprint 61
Sprint 61
 
Maintaining spatial data infrastructures (SDIs) using distributed task queues
Maintaining spatial data infrastructures (SDIs) using distributed task queuesMaintaining spatial data infrastructures (SDIs) using distributed task queues
Maintaining spatial data infrastructures (SDIs) using distributed task queues
 
Write an API for Almost Anything: The Amazing Power and Flexibility of Django...
Write an API for Almost Anything: The Amazing Power and Flexibility of Django...Write an API for Almost Anything: The Amazing Power and Flexibility of Django...
Write an API for Almost Anything: The Amazing Power and Flexibility of Django...
 
Introduction to Python Celery
Introduction to Python CeleryIntroduction to Python Celery
Introduction to Python Celery
 
Write an API for Almost Anything: The Amazing Power and Flexibility of Django...
Write an API for Almost Anything: The Amazing Power and Flexibility of Django...Write an API for Almost Anything: The Amazing Power and Flexibility of Django...
Write an API for Almost Anything: The Amazing Power and Flexibility of Django...
 
AthenaX - Unified Stream & Batch Processing using SQL at Uber, Zhenqiu Huang,...
AthenaX - Unified Stream & Batch Processing using SQL at Uber, Zhenqiu Huang,...AthenaX - Unified Stream & Batch Processing using SQL at Uber, Zhenqiu Huang,...
AthenaX - Unified Stream & Batch Processing using SQL at Uber, Zhenqiu Huang,...
 
Sprint 60
Sprint 60Sprint 60
Sprint 60
 
Api presentation
Api presentationApi presentation
Api presentation
 
Sprint 66
Sprint 66Sprint 66
Sprint 66
 
LuaNode: Asynchronous I/O for Lua
LuaNode: Asynchronous I/O for LuaLuaNode: Asynchronous I/O for Lua
LuaNode: Asynchronous I/O for Lua
 
New features in Java 9: Modularity & Process handling
New features in Java 9: Modularity & Process handlingNew features in Java 9: Modularity & Process handling
New features in Java 9: Modularity & Process handling
 
Node js
Node jsNode js
Node js
 
Java 9 has these new features!
Java 9 has these new features!Java 9 has these new features!
Java 9 has these new features!
 

Recently uploaded

How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 

Recently uploaded (20)

How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 

Drupal course - batch API

  • 1. Batch API Dániel Kalmár March 28, 2013
  • 3. What is batch API? ● Batch (execution of a series of “jobs”) ● Application Programming Interface ● Avoid PHP timeout ● Spread out the processing over several page requests ● Feedback for users (progress bar) ● Cannot use in cron jobs
  • 4. When can batch API be useful? ● designed to integrate with the Form API workflow ● can be used by non-Form API scripts (update, page callbacks) ● site install (module install) ● bulk operations (nodes, users) ● search API (indexing)
  • 5. Functions ● batch_get() ● batch_process() ● batch_set() ● hook_batch_alter() ● _batch_populate_queue() ● _batch_queue()
  • 6. How does it work?
  • 8. Process ● set batch operation ● execute batch operation (only need outside of a form submit handler)
  • 9. Operations ● $context ● Set the starting values
  • 10. Operations ● update the values in each steps
  • 11. Operations ● check if all the steps have been executed
  • 15. What is cron queue? ● cron ● hooks ● queue API ● limit the processing time of a queue per cron run
  • 16. When can cron queue be useful? ● processing large amounts of data in cron ● bulk operations (nodes, users) ● regular newsletter sending
  • 17. How does it work?
  • 18. Define a queue ● Implement hook_cron_queue_info()
  • 19. Load the queue ● Loading items in the queue in hook_cron()
  • 20. Process a queue item ● worker callback deals with the individual queue items