SlideShare a Scribd company logo
1 of 19
http://twitter.com/GianArb
Queue system
gianarb92@gmail.com Gianluca Arbezzano 1
Gianluca Arbezzano
@GianArb
http://github.com/gianarb
http://twitter.com/GianArb
TODO
• Send a mail
• Upload big file
• Imports
• Messagging
• …
gianarb92@gmail.com Gianluca Arbezzano 2
http://twitter.com/GianArb
Only one Role
gianarb92@gmail.com Gianluca Arbezzano 3
You DON’T MAKE to user wait
http://twitter.com/GianArb
The solution is…
gianarb92@gmail.com Gianluca Arbezzano 4
http://twitter.com/GianArb
Queue System
gianarb92@gmail.com Gianluca Arbezzano 5
• Queue
• Producer
• Consumer
• Message
http://twitter.com/GianArb
Queue
gianarb92@gmail.com Gianluca Arbezzano 6
ZendQueueQueue
// Create an array queue adapter
$adapter = new ArrayAdapter();
// Create a queue object
$queue = new Queue('queue1', $adapter);
Adapter
• Db
• MongoDb
• MongoCappedCollection
• ArrayAdapter
• TODO: Redis
• TODO: RabbitMQ
http://twitter.com/GianArb
Message Queue
Message queues provide an asynchronous
communications protocol, meaning that the
sender and receiver of the message do not need
to interact with the message queue at the same
time.
Cit. Wikipedia
gianarb92@gmail.com Gianluca Arbezzano 7
ZendQueueMessageMessage implement ZendStdlibMessage
http://twitter.com/GianArb
Producer
• Send messages quickly
gianarb92@gmail.com Gianluca Arbezzano 8
Consumer
• Receive messages
• Usually it’s a worker that consumes one
message at time.
http://twitter.com/GianArb
Queue System, when?
gianarb92@gmail.com Gianluca Arbezzano 9
Registration Query Mail
• Time-shifts job processing when the “CPU” is
less busy
• Distributed computing
• In a web app allows to run tasks in background
reducing the http request time
http://twitter.com/GianArb
Workflow
gianarb92@gmail.com Gianluca Arbezzano 10
Registration Query
Send Message
in queue
Send mail
Send mail
Send mail
Send mail
Send mailWORKER
http://twitter.com/GianArb
Worker (old way)
use ZendQueueQueue;
do {
$messages = $queue->receive();
//do some work
sleep(1);
} while (…)
gianarb92@gmail.com Gianluca Arbezzano 11
http://twitter.com/GianArb
WORKERS!
gianarb92@gmail.com Gianluca Arbezzano 12
http://twitter.com/GianArb
Await
gianarb92@gmail.com Gianluca Arbezzano 13
$queue->await()
http://twitter.com/GianArb
Role
• Your adapter implement awaitMessage()
• || your queue can emulate await
gianarb92@gmail.com Gianluca Arbezzano 14
$adapter->awaitMessages(Queue $queue,
$callback, ReceiveParameters $params = null)
http://twitter.com/GianArb
*callback
gianarb92@gmail.com Gianluca Arbezzano 15
http://twitter.com/GianArb
Worker
use ZendQueueQueue;
use ZendQueueQueueEvent;
$queue->getEventManager()-
>attach(QueueEvent::EVENT_RECEIVE, function (QueueEvent $e) use
($queue) {
$message = $e->getMessages()->current();
//do some work
$queue->delete($message);
});
//Wait for incoming messages
$queue->await();
gianarb92@gmail.com Gianluca Arbezzano 16
http://twitter.com/GianArb
Use case overview
• Short run jobs
• Long run jobs
• Schedule jobs (like cron jobs)
• Enterprise service bus
gianarb92@gmail.com Gianluca Arbezzano 17
http://twitter.com/GianArb
Links!
• Use case
https://github.com/ripaclub/ZendQueue/wiki/
Example-Usage
• Proposal
https://github.com/ripaclub/ZendQueue/wiki/
ZendQueue-Proposal
gianarb92@gmail.com Gianluca Arbezzano 18
http://twitter.com/GianArb
Ripa Club
gianarb92@gmail.com Gianluca Arbezzano 19
Powered by
http://github.com/ripaclub

More Related Content

What's hot

What's hot (20)

TuleapCon2017 -Automating Jenkins build with Tuleap trackers
TuleapCon2017 -Automating Jenkins build with Tuleap trackersTuleapCon2017 -Automating Jenkins build with Tuleap trackers
TuleapCon2017 -Automating Jenkins build with Tuleap trackers
 
SalesBites 1 of 4
SalesBites 1 of 4SalesBites 1 of 4
SalesBites 1 of 4
 
Sane Plugin Updates - WordCamp New York City, 2014
Sane Plugin Updates - WordCamp New York City, 2014Sane Plugin Updates - WordCamp New York City, 2014
Sane Plugin Updates - WordCamp New York City, 2014
 
Yet Another Perl Cooking
Yet Another Perl CookingYet Another Perl Cooking
Yet Another Perl Cooking
 
Contributing to Impala
Contributing to ImpalaContributing to Impala
Contributing to Impala
 
SMO Like a Boss with IFTTT by Jeff Hawley
SMO Like a Boss with IFTTT by Jeff HawleySMO Like a Boss with IFTTT by Jeff Hawley
SMO Like a Boss with IFTTT by Jeff Hawley
 
Andrew Mager, Spotify
Andrew Mager, SpotifyAndrew Mager, Spotify
Andrew Mager, Spotify
 
Web APIs - Best practices
Web APIs - Best practicesWeb APIs - Best practices
Web APIs - Best practices
 
TuleapCon2017-Bugzilla-integration
TuleapCon2017-Bugzilla-integrationTuleapCon2017-Bugzilla-integration
TuleapCon2017-Bugzilla-integration
 
WordPress SFO Meetup - Gutenberg FAQ
WordPress SFO Meetup - Gutenberg FAQWordPress SFO Meetup - Gutenberg FAQ
WordPress SFO Meetup - Gutenberg FAQ
 
TuleapCon2017-Pack-Stackstorm-Github-issues
TuleapCon2017-Pack-Stackstorm-Github-issuesTuleapCon2017-Pack-Stackstorm-Github-issues
TuleapCon2017-Pack-Stackstorm-Github-issues
 
Debugging Tips and Tricks
Debugging Tips and TricksDebugging Tips and Tricks
Debugging Tips and Tricks
 
Sync_Asana_Github
Sync_Asana_GithubSync_Asana_Github
Sync_Asana_Github
 
A Practical Approach to React Native at All Things Open Conference
A Practical Approach to React Native at All Things Open ConferenceA Practical Approach to React Native at All Things Open Conference
A Practical Approach to React Native at All Things Open Conference
 
EclipseCon France-2017-Tuleap-new-big-features
EclipseCon France-2017-Tuleap-new-big-featuresEclipseCon France-2017-Tuleap-new-big-features
EclipseCon France-2017-Tuleap-new-big-features
 
RxJS: A Beginner & Expert's Perspective - ng-conf 2017
RxJS: A Beginner & Expert's Perspective - ng-conf 2017RxJS: A Beginner & Expert's Perspective - ng-conf 2017
RxJS: A Beginner & Expert's Perspective - ng-conf 2017
 
TuleapCon2017-Mattermost-integration
TuleapCon2017-Mattermost-integrationTuleapCon2017-Mattermost-integration
TuleapCon2017-Mattermost-integration
 
How I did create Telegram bot - Roman Senin
How I did create Telegram bot - Roman SeninHow I did create Telegram bot - Roman Senin
How I did create Telegram bot - Roman Senin
 
Postman covid-webinar
Postman covid-webinarPostman covid-webinar
Postman covid-webinar
 
TuleapCon2017-Case-Study-Orange
TuleapCon2017-Case-Study-OrangeTuleapCon2017-Case-Study-Orange
TuleapCon2017-Case-Study-Orange
 

Viewers also liked

Case study: iTunes for K-12
Case study: iTunes for K-12Case study: iTunes for K-12
Case study: iTunes for K-12
Giorgio Sironi
 
Distributed app development with nodejs and zeromq
Distributed app development with nodejs and zeromqDistributed app development with nodejs and zeromq
Distributed app development with nodejs and zeromq
Ruben Tan
 
Case study: Khan Academy
Case study: Khan AcademyCase study: Khan Academy
Case study: Khan Academy
Giorgio Sironi
 
Smart blind stick book
Smart blind stick bookSmart blind stick book
Smart blind stick book
Ahmed Moawad
 

Viewers also liked (20)

Queue your work
Queue your workQueue your work
Queue your work
 
ZfDayIt 2014 - There is a module for everything
ZfDayIt 2014 - There is a module for everythingZfDayIt 2014 - There is a module for everything
ZfDayIt 2014 - There is a module for everything
 
Chansonnier: web application for multimedia search on song videos
Chansonnier: web application for multimedia search on song videosChansonnier: web application for multimedia search on song videos
Chansonnier: web application for multimedia search on song videos
 
CouchDB @ PoliMi
CouchDB @ PoliMiCouchDB @ PoliMi
CouchDB @ PoliMi
 
Case study: Insegnalo
Case study: InsegnaloCase study: Insegnalo
Case study: Insegnalo
 
Case study: iTunes for K-12
Case study: iTunes for K-12Case study: iTunes for K-12
Case study: iTunes for K-12
 
Docker 1.12 and SwarmKit
Docker 1.12 and SwarmKitDocker 1.12 and SwarmKit
Docker 1.12 and SwarmKit
 
Faster PHP apps using Queues and Workers
Faster PHP apps using Queues and WorkersFaster PHP apps using Queues and Workers
Faster PHP apps using Queues and Workers
 
Blind detection of image manipulation @ PoliMi
Blind detection of image manipulation @ PoliMiBlind detection of image manipulation @ PoliMi
Blind detection of image manipulation @ PoliMi
 
PHP and node.js Together
PHP and node.js TogetherPHP and node.js Together
PHP and node.js Together
 
Distributed app development with nodejs and zeromq
Distributed app development with nodejs and zeromqDistributed app development with nodejs and zeromq
Distributed app development with nodejs and zeromq
 
Distributed Queue System using Gearman
Distributed Queue System using GearmanDistributed Queue System using Gearman
Distributed Queue System using Gearman
 
Case study: Khan Academy
Case study: Khan AcademyCase study: Khan Academy
Case study: Khan Academy
 
Navigation system for blind using GPS & GSM
Navigation system for blind using GPS & GSMNavigation system for blind using GPS & GSM
Navigation system for blind using GPS & GSM
 
Map Projections, Datums, GIS and GPS for Everyone
Map Projections, Datums, GIS and GPS for EveryoneMap Projections, Datums, GIS and GPS for Everyone
Map Projections, Datums, GIS and GPS for Everyone
 
Smart blind stick book
Smart blind stick bookSmart blind stick book
Smart blind stick book
 
Vehicle tracking system using gps and google map
Vehicle tracking system using gps and google mapVehicle tracking system using gps and google map
Vehicle tracking system using gps and google map
 
Vehicle tracking system using gps and gsm
Vehicle tracking system using gps and gsmVehicle tracking system using gps and gsm
Vehicle tracking system using gps and gsm
 
Vehicle tracking system using GSM and GPS
Vehicle tracking system using GSM and GPSVehicle tracking system using GSM and GPS
Vehicle tracking system using GSM and GPS
 
Vehicle tracking system using gps and gsm techniques
Vehicle tracking system using gps and gsm techniquesVehicle tracking system using gps and gsm techniques
Vehicle tracking system using gps and gsm techniques
 

Similar to Queue System and Zend\Queue implementation (9)

Git first contributions
Git first contributionsGit first contributions
Git first contributions
 
Contributing to Akka (Hacktoberfest 2020)
Contributing to Akka (Hacktoberfest 2020)Contributing to Akka (Hacktoberfest 2020)
Contributing to Akka (Hacktoberfest 2020)
 
Git and GitHub crash course
Git and GitHub crash courseGit and GitHub crash course
Git and GitHub crash course
 
GR8CONF Contributing Back To Grails
GR8CONF Contributing Back To GrailsGR8CONF Contributing Back To Grails
GR8CONF Contributing Back To Grails
 
Git isthenewsexy
Git isthenewsexyGit isthenewsexy
Git isthenewsexy
 
Python korea 2012 11-24-github
Python korea 2012 11-24-githubPython korea 2012 11-24-github
Python korea 2012 11-24-github
 
From 0 to Ember
From 0 to EmberFrom 0 to Ember
From 0 to Ember
 
Matt Gauger - Git & Github web414 December 2010
Matt Gauger - Git & Github web414 December 2010Matt Gauger - Git & Github web414 December 2010
Matt Gauger - Git & Github web414 December 2010
 
How I become Go GDE
How I become Go GDEHow I become Go GDE
How I become Go GDE
 

More from Gianluca Arbezzano

More from Gianluca Arbezzano (17)

Kubernetes debug like a pro
Kubernetes debug like a proKubernetes debug like a pro
Kubernetes debug like a pro
 
OSDC 2018 - Distributed monitoring
OSDC 2018 - Distributed monitoringOSDC 2018 - Distributed monitoring
OSDC 2018 - Distributed monitoring
 
Value of your metrics: goodbye monitoring, welcome observability
Value of your metrics: goodbye monitoring, welcome observabilityValue of your metrics: goodbye monitoring, welcome observability
Value of your metrics: goodbye monitoring, welcome observability
 
InfluxCloudi craft container orchestrator
InfluxCloudi craft container orchestratorInfluxCloudi craft container orchestrator
InfluxCloudi craft container orchestrator
 
Orbiter and how to extend Docker Swarm
Orbiter and how to extend Docker SwarmOrbiter and how to extend Docker Swarm
Orbiter and how to extend Docker Swarm
 
Overview and Opentracing in theory by Gianluca Arbezzano
Overview and Opentracing in theory by Gianluca ArbezzanoOverview and Opentracing in theory by Gianluca Arbezzano
Overview and Opentracing in theory by Gianluca Arbezzano
 
Monitoring Pull vs Push, InfluxDB and Prometheus
Monitoring Pull vs Push, InfluxDB and PrometheusMonitoring Pull vs Push, InfluxDB and Prometheus
Monitoring Pull vs Push, InfluxDB and Prometheus
 
Open Tracing, to order and understand your mess. - ApiConf 2017
Open Tracing, to order and understand your mess. - ApiConf 2017Open Tracing, to order and understand your mess. - ApiConf 2017
Open Tracing, to order and understand your mess. - ApiConf 2017
 
Security Tips to run Docker in Production
Security Tips to run Docker in ProductionSecurity Tips to run Docker in Production
Security Tips to run Docker in Production
 
Jenkins in the real world - DevOpsCon 2017
Jenkins in the real world - DevOpsCon 2017Jenkins in the real world - DevOpsCon 2017
Jenkins in the real world - DevOpsCon 2017
 
Monitor your application and sleep
Monitor your application and sleepMonitor your application and sleep
Monitor your application and sleep
 
Tick Stack - Listen your infrastructure and please sleep
Tick Stack - Listen your infrastructure and please sleepTick Stack - Listen your infrastructure and please sleep
Tick Stack - Listen your infrastructure and please sleep
 
Docker Novosibirsk Meetup #3 - Docker in Production
Docker Novosibirsk Meetup #3 - Docker in ProductionDocker Novosibirsk Meetup #3 - Docker in Production
Docker Novosibirsk Meetup #3 - Docker in Production
 
DockerDublin Meetup - News about Docker 1.13
DockerDublin Meetup -  News about Docker 1.13DockerDublin Meetup -  News about Docker 1.13
DockerDublin Meetup - News about Docker 1.13
 
Time Series Database and Tick Stack
Time Series Database and Tick StackTime Series Database and Tick Stack
Time Series Database and Tick Stack
 
Vagrant - PugMI
Vagrant - PugMIVagrant - PugMI
Vagrant - PugMI
 
Silex, iniziamo
Silex, iniziamoSilex, iniziamo
Silex, iniziamo
 

Recently uploaded

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Recently uploaded (20)

Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 

Queue System and Zend\Queue implementation