SlideShare a Scribd company logo
1 of 16
Download to read offline
GearmanBundle
SymfonyCon Warsaw Edition
@Mmoreram
Bafactory, Barcelona
GearmanBundle
Providing Gearman support on your SF2 projects
<?php
namespace AcmeAcmeBundleWorkers;
!

/**
* My simple Acme Class
*/
class AcmeClass
{
/**
* My simple acme class method
*/
public function action()
{
!

}
}
<?php
namespace AcmeAcmeBundleWorkers;
!

use MmoreramGearmanBundleDriverGearman;
!

/**
* @GearmanWork(name=“myworker”)
*/
class AcmeClass
{
/**
* @GearmanJob
*/
public function action(GearmanJob $job)
{
// Do some stuff
}
}
$ php app/console gearman:workers:list
!

	 @Worker: AcmeAcmeBundleWorkersAcmeClass
	 callablename: myworker
	 Jobs:
	 	 - #1
	 	 name: action
	 	 callablename: myworker~action
$ php app/console gearman:worker:execute myworker
Supervisord

WorkerWorker
Worker
Worker
Worker Worker
$this
->getContainer()
->get(‘gearman')
->doJob(‘myworker’, ‘value’);
<?php
namespace AcmeAcmeBundleWorkers;
!

use MmoreramGearmanBundleDriverGearman;
!

/**
* @GearmanWork(name=“myworker”)
*/
class AcmeClass
{
/**
* @GearmanJob
*/
public function action(GearmanJob $job)
{
$workload = $job->workload();
}
}
Dependencies? W
AAS
(Worker as a service)
–Concept invented by me, like a boss…
<?php
namespace AcmeAcmeBundleWorkers;
!

use MmoreramGearmanBundleDriverGearman;
!

/**
* @GearmanWork(name=“myworker”, service=“worker.myworker”)
*/
class AcmeClass
{
/**
* @GearmanJob
*/
public function action(GearmanJob $job)
{
$workload = $job->workload();
}
}
<?php
namespace AcmeAcmeBundleWorkers;
!

use SymfonyComponentDependencyInjectionContainerAwareInterface;
use MmoreramGearmanBundleDriverGearman;
!

/**
* @GearmanWork(name=“myworker”, service=“worker.myworker”)
*/
class AcmeClass instanceof ContainerAwareInterface
{
/**
* @GearmanJob
*/
public function action(GearmanJob $job)
{
$workload = $job->workload();
}
}
What else?

Many features available for developers
Improving day by day all code, adding features and
resolving issues
50 daily downloads ( Not as popular as Symfony
packages… )
Platinum medal on SensioLabs Insight
I encourage you to use Queues

And that you use GearmanBundle :)
Moltes Gràcies,
Thanks!

More Related Content

What's hot

IRC HTTP Stream in YAPC::Asia 2009
IRC HTTP Stream in YAPC::Asia 2009IRC HTTP Stream in YAPC::Asia 2009
IRC HTTP Stream in YAPC::Asia 2009
Yusuke Wada
 
FOSDEM 2012: Practical implementation of promise theory in CFEngine
FOSDEM 2012: Practical implementation of promise theory in CFEngineFOSDEM 2012: Practical implementation of promise theory in CFEngine
FOSDEM 2012: Practical implementation of promise theory in CFEngine
dottedmag
 
The ten commandments for an Agile Developer
The ten commandments for an Agile DeveloperThe ten commandments for an Agile Developer
The ten commandments for an Agile Developer
Sowmya Karmali
 

What's hot (20)

Ansible Israel Kickoff Meetup
Ansible Israel Kickoff MeetupAnsible Israel Kickoff Meetup
Ansible Israel Kickoff Meetup
 
IRC HTTP Stream in YAPC::Asia 2009
IRC HTTP Stream in YAPC::Asia 2009IRC HTTP Stream in YAPC::Asia 2009
IRC HTTP Stream in YAPC::Asia 2009
 
{{components deepDive=true}}
{{components deepDive=true}}{{components deepDive=true}}
{{components deepDive=true}}
 
Capistrano
CapistranoCapistrano
Capistrano
 
FOSDEM 2012: Practical implementation of promise theory in CFEngine
FOSDEM 2012: Practical implementation of promise theory in CFEngineFOSDEM 2012: Practical implementation of promise theory in CFEngine
FOSDEM 2012: Practical implementation of promise theory in CFEngine
 
Using assm in service object
Using assm in service object Using assm in service object
Using assm in service object
 
The ten commandments for an Agile Developer
The ten commandments for an Agile DeveloperThe ten commandments for an Agile Developer
The ten commandments for an Agile Developer
 
Accessing Mule variables in groovy
Accessing Mule variables in groovyAccessing Mule variables in groovy
Accessing Mule variables in groovy
 
AngularJS (1.x) as fast as a lightning
AngularJS (1.x)as fast as a lightningAngularJS (1.x)as fast as a lightning
AngularJS (1.x) as fast as a lightning
 
Multi tenant/lang application with Ruby on Rails
Multi tenant/lang application with Ruby on RailsMulti tenant/lang application with Ruby on Rails
Multi tenant/lang application with Ruby on Rails
 
Reactive Angular 2
Reactive Angular 2Reactive Angular 2
Reactive Angular 2
 
The evolution of asynchronous javascript
The evolution of asynchronous javascriptThe evolution of asynchronous javascript
The evolution of asynchronous javascript
 
CasperJS
CasperJSCasperJS
CasperJS
 
Intro to Asynchronous Javascript
Intro to Asynchronous JavascriptIntro to Asynchronous Javascript
Intro to Asynchronous Javascript
 
Asynchronous JavaScript Programming with Callbacks & Promises
Asynchronous JavaScript Programming with Callbacks & PromisesAsynchronous JavaScript Programming with Callbacks & Promises
Asynchronous JavaScript Programming with Callbacks & Promises
 
Apache Syncope: an Apache Camel Integration Proposal
Apache Syncope: an Apache Camel Integration ProposalApache Syncope: an Apache Camel Integration Proposal
Apache Syncope: an Apache Camel Integration Proposal
 
Installing symfony within netbeans and WAMP
Installing symfony within netbeans and WAMPInstalling symfony within netbeans and WAMP
Installing symfony within netbeans and WAMP
 
You promise?
You promise?You promise?
You promise?
 
Présentation de HomeKit
Présentation de HomeKitPrésentation de HomeKit
Présentation de HomeKit
 
Groovy in Mule
Groovy in MuleGroovy in Mule
Groovy in Mule
 

Viewers also liked

Yeni metin belgesi (2)
Yeni metin belgesi (2)Yeni metin belgesi (2)
Yeni metin belgesi (2)
makarnalar
 
Distribusi binomial
Distribusi binomial Distribusi binomial
Distribusi binomial
DeskyRizal
 
Distribusi binomial
Distribusi binomial Distribusi binomial
Distribusi binomial
DeskyRizal
 

Viewers also liked (15)

Yeni metin belgesi (2)
Yeni metin belgesi (2)Yeni metin belgesi (2)
Yeni metin belgesi (2)
 
Painting thesis.
Painting thesis.Painting thesis.
Painting thesis.
 
Engineering a New Approach to Mitral Valve Regurgitation: Direct Plication An...
Engineering a New Approach to Mitral Valve Regurgitation: Direct Plication An...Engineering a New Approach to Mitral Valve Regurgitation: Direct Plication An...
Engineering a New Approach to Mitral Valve Regurgitation: Direct Plication An...
 
Linux vs windows
Linux vs windowsLinux vs windows
Linux vs windows
 
Material 02 (2)
Material 02 (2)Material 02 (2)
Material 02 (2)
 
Pi eva sophieridderikhoff
Pi eva sophieridderikhoffPi eva sophieridderikhoff
Pi eva sophieridderikhoff
 
Iki sey
Iki seyIki sey
Iki sey
 
Dependency injection
Dependency injectionDependency injection
Dependency injection
 
Linux vs windows
Linux vs windowsLinux vs windows
Linux vs windows
 
Crawling the world
Crawling the worldCrawling the world
Crawling the world
 
When e-commerce meets Symfony
When e-commerce meets SymfonyWhen e-commerce meets Symfony
When e-commerce meets Symfony
 
Form Gaji Karyawan
Form Gaji KaryawanForm Gaji Karyawan
Form Gaji Karyawan
 
Strategic marketing-planning swam-tcm40-158995
Strategic marketing-planning swam-tcm40-158995Strategic marketing-planning swam-tcm40-158995
Strategic marketing-planning swam-tcm40-158995
 
Distribusi binomial
Distribusi binomial Distribusi binomial
Distribusi binomial
 
Distribusi binomial
Distribusi binomial Distribusi binomial
Distribusi binomial
 

Similar to Gearman bundle, Warszawa 2013 edition

Distributed work with Gearman
Distributed work with GearmanDistributed work with Gearman
Distributed work with Gearman
Dominik Jungowski
 
Desymfony 2011 - Habemus Bundles
Desymfony 2011 - Habemus BundlesDesymfony 2011 - Habemus Bundles
Desymfony 2011 - Habemus Bundles
Albert Jessurum
 
Exploiting the newer perl to improve your plugins
Exploiting the newer perl to improve your pluginsExploiting the newer perl to improve your plugins
Exploiting the newer perl to improve your plugins
Marian Marinov
 
Gearmanpresentation 110308165409-phpapp01
Gearmanpresentation 110308165409-phpapp01Gearmanpresentation 110308165409-phpapp01
Gearmanpresentation 110308165409-phpapp01
longtuan
 

Similar to Gearman bundle, Warszawa 2013 edition (20)

Distributed work with Gearman
Distributed work with GearmanDistributed work with Gearman
Distributed work with Gearman
 
Desymfony 2011 - Habemus Bundles
Desymfony 2011 - Habemus BundlesDesymfony 2011 - Habemus Bundles
Desymfony 2011 - Habemus Bundles
 
Gearman and Perl
Gearman and PerlGearman and Perl
Gearman and Perl
 
JavaScript and UI Architecture Best Practices
JavaScript and UI Architecture Best PracticesJavaScript and UI Architecture Best Practices
JavaScript and UI Architecture Best Practices
 
Exploiting the newer perl to improve your plugins
Exploiting the newer perl to improve your pluginsExploiting the newer perl to improve your plugins
Exploiting the newer perl to improve your plugins
 
Distributed Applications with Perl & Gearman
Distributed Applications with Perl & GearmanDistributed Applications with Perl & Gearman
Distributed Applications with Perl & Gearman
 
Gearman - Job Queue
Gearman - Job QueueGearman - Job Queue
Gearman - Job Queue
 
The Enterprise Wor/d/thy/Press
The Enterprise Wor/d/thy/PressThe Enterprise Wor/d/thy/Press
The Enterprise Wor/d/thy/Press
 
Vagrant for real codemotion (moar tips! ;-))
Vagrant for real codemotion (moar tips! ;-))Vagrant for real codemotion (moar tips! ;-))
Vagrant for real codemotion (moar tips! ;-))
 
Gearman & PHP
Gearman & PHPGearman & PHP
Gearman & PHP
 
Ansible 2.0
Ansible 2.0Ansible 2.0
Ansible 2.0
 
AMIMOTO: WordPress + Amazon Web Services Hands-on PARIS
AMIMOTO: WordPress + Amazon Web Services Hands-on PARISAMIMOTO: WordPress + Amazon Web Services Hands-on PARIS
AMIMOTO: WordPress + Amazon Web Services Hands-on PARIS
 
Gearmanpresentation 110308165409-phpapp01
Gearmanpresentation 110308165409-phpapp01Gearmanpresentation 110308165409-phpapp01
Gearmanpresentation 110308165409-phpapp01
 
Beyond AEM Curl Commands
Beyond AEM Curl CommandsBeyond AEM Curl Commands
Beyond AEM Curl Commands
 
Curso Symfony - Clase 3
Curso Symfony - Clase 3Curso Symfony - Clase 3
Curso Symfony - Clase 3
 
OSCON - ES6 metaprogramming unleashed
OSCON -  ES6 metaprogramming unleashedOSCON -  ES6 metaprogramming unleashed
OSCON - ES6 metaprogramming unleashed
 
Creating a modern web application using Symfony API Platform Atlanta
Creating a modern web application using  Symfony API Platform AtlantaCreating a modern web application using  Symfony API Platform Atlanta
Creating a modern web application using Symfony API Platform Atlanta
 
PHP 5.3
PHP 5.3PHP 5.3
PHP 5.3
 
Javascript quiz. Questions to ask when recruiting developers.
Javascript quiz. Questions to ask when recruiting developers.Javascript quiz. Questions to ask when recruiting developers.
Javascript quiz. Questions to ask when recruiting developers.
 
Single Sourcing RAP and RCP - Desktop and web clients from a single code base
Single Sourcing RAP and RCP - Desktop and web clients from a single code baseSingle Sourcing RAP and RCP - Desktop and web clients from a single code base
Single Sourcing RAP and RCP - Desktop and web clients from a single code base
 

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
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 

Recently uploaded (20)

🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
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
 
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
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
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
 
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
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
[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
 
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
 
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...
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 

Gearman bundle, Warszawa 2013 edition