SlideShare a Scribd company logo
1 of 40
YAPC::Asia 2009 Tokyo 2009/9/10 Gosuke Miyashita
Speaker ,[object Object],[object Object],[object Object],[object Object],[object Object]
 
 
Agenda ,[object Object],[object Object],[object Object],[object Object],[object Object]
 
Event driven programming ,[object Object],[object Object]
Events ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Main loop ,[object Object],[object Object],[object Object],[object Object]
Eaxmple of main loop Process timers Wait I/O events Process I/O events Post main loop process
 
Events supported by Danga::Socket ,[object Object],[object Object]
Process I/O events ,[object Object],[object Object],[object Object],[object Object],[object Object]
Add I/O watcher with Danga::Socket ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Add I/O wathcer (pattern 2) ,[object Object],[object Object],[object Object],[object Object],[object Object]
Add I/O watcher (pattern 3) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Add timer watcher with Danga::Socket ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Start main loop with Danga::Socket ,[object Object]
Main loop(again) Process Timers Wait I/O events Process I/O events Post main loop process
 
Perlbal mechanism(as reverse proxy) BackendHTTP ClientProxy TCPListener Client Server ClientProxy Client BackendHTTP Danga::Socket based objects
Perlbal with a plugin (on start_proxy_request hook) BackendHTTP ClientProxy TCPListener Client Server Plugin::Hoge Target of this session
 
Hooks ,[object Object],[object Object]
In case of a synchronous plugin ClientProxy TCPListener Client Server Plugin::Sync Client
In case of an asynchronous plugin ClientProxy TCPListener Client Server Plugin::Async Client ClientProxy
How to write asynchronous plugins? ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
How to write asynchronous plugins? ,[object Object],[object Object],[object Object]
Main process of a plugin ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Attention ,[object Object],[object Object],[object Object],[object Object],[object Object]
plugin register ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Call asynchronous process ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
In case of “return 0” BackendHTTP ClientProxy TCPListener Client Server Plugin::Async Go to next step even if Plugin::Async is not  finished
“ return 1” & “call back” BackendHTTP ClientProxy TCPListener Client Plugin::Async Stop the process and go to main loop Server return 1 call back
Call back function ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Call back function ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Patch of ClientProxy::handle_request ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
 
Points of asynchronous Perlbal plugins ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
 

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
 
Design patterns as power of programing
Design patterns as power of programingDesign patterns as power of programing
Design patterns as power of programing
Lukas Lesniewski
 

What's hot (20)

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
 
Learn flask in 90mins
Learn flask in 90minsLearn flask in 90mins
Learn flask in 90mins
 
Capistrano
CapistranoCapistrano
Capistrano
 
톰캣 #04-환경설정
톰캣 #04-환경설정톰캣 #04-환경설정
톰캣 #04-환경설정
 
PowerShell: Automation for everyone
PowerShell: Automation for everyonePowerShell: Automation for everyone
PowerShell: Automation for everyone
 
appache_1
appache_1appache_1
appache_1
 
LvivPy - Flask in details
LvivPy - Flask in detailsLvivPy - Flask in details
LvivPy - Flask in details
 
WP Weekend #2 - Corcel, aneb WordPress přes Laravel
WP Weekend #2 - Corcel, aneb WordPress přes LaravelWP Weekend #2 - Corcel, aneb WordPress přes Laravel
WP Weekend #2 - Corcel, aneb WordPress přes Laravel
 
Capistrano Overview
Capistrano OverviewCapistrano Overview
Capistrano Overview
 
GTLAB Overview
GTLAB OverviewGTLAB Overview
GTLAB Overview
 
Ruby C10K: High Performance Networking - RubyKaigi '09
Ruby C10K: High Performance Networking - RubyKaigi '09Ruby C10K: High Performance Networking - RubyKaigi '09
Ruby C10K: High Performance Networking - RubyKaigi '09
 
Flask – Python
Flask – PythonFlask – Python
Flask – Python
 
Mcollective introduction
Mcollective introductionMcollective introduction
Mcollective introduction
 
Task Scheduling and Asynchronous Processing Evolved. Zend Server Job Queue
Task Scheduling and Asynchronous Processing Evolved. Zend Server Job QueueTask Scheduling and Asynchronous Processing Evolved. Zend Server Job Queue
Task Scheduling and Asynchronous Processing Evolved. Zend Server Job Queue
 
Design patterns as power of programing
Design patterns as power of programingDesign patterns as power of programing
Design patterns as power of programing
 
Making Symofny shine with Varnish - SymfonyCon Madrid 2014
Making Symofny shine with Varnish - SymfonyCon Madrid 2014Making Symofny shine with Varnish - SymfonyCon Madrid 2014
Making Symofny shine with Varnish - SymfonyCon Madrid 2014
 
Python Flask Tutorial For Beginners | Flask Web Development Tutorial | Python...
Python Flask Tutorial For Beginners | Flask Web Development Tutorial | Python...Python Flask Tutorial For Beginners | Flask Web Development Tutorial | Python...
Python Flask Tutorial For Beginners | Flask Web Development Tutorial | Python...
 
Introducing Revel
Introducing RevelIntroducing Revel
Introducing Revel
 
Puppet Camp DC 2014: Managing Puppet with MCollective
Puppet Camp DC 2014: Managing Puppet with MCollectivePuppet Camp DC 2014: Managing Puppet with MCollective
Puppet Camp DC 2014: Managing Puppet with MCollective
 
Real Time Event Dispatcher
Real Time Event DispatcherReal Time Event Dispatcher
Real Time Event Dispatcher
 

Viewers also liked

Open Source System Administration Framework - Func
Open Source System Administration Framework - FuncOpen Source System Administration Framework - Func
Open Source System Administration Framework - Func
Gosuke Miyashita
 
Danga::Socketの非同期処理の仕組みとPerlbalで非同期処理するプラグインを書く方法
Danga::Socketの非同期処理の仕組みとPerlbalで非同期処理するプラグインを書く方法Danga::Socketの非同期処理の仕組みとPerlbalで非同期処理するプラグインを書く方法
Danga::Socketの非同期処理の仕組みとPerlbalで非同期処理するプラグインを書く方法
Gosuke Miyashita
 
Inside Sqale's Backend at YAPC::Asia Tokyo 2012
Inside Sqale's Backend at YAPC::Asia Tokyo 2012Inside Sqale's Backend at YAPC::Asia Tokyo 2012
Inside Sqale's Backend at YAPC::Asia Tokyo 2012
Gosuke Miyashita
 
Puppet Best Practices? at COOKPAD
Puppet Best Practices? at COOKPADPuppet Best Practices? at COOKPAD
Puppet Best Practices? at COOKPAD
Gosuke Miyashita
 
Inside Sqale's Backend at Sapporo Ruby Kaigi 2012
Inside Sqale's Backend at Sapporo Ruby Kaigi 2012Inside Sqale's Backend at Sapporo Ruby Kaigi 2012
Inside Sqale's Backend at Sapporo Ruby Kaigi 2012
Gosuke Miyashita
 
Serverspec at July Tech Festa 2013
Serverspec at July Tech Festa 2013Serverspec at July Tech Festa 2013
Serverspec at July Tech Festa 2013
Gosuke Miyashita
 

Viewers also liked (8)

Tanz!
Tanz!Tanz!
Tanz!
 
Open Source System Administration Framework - Func
Open Source System Administration Framework - FuncOpen Source System Administration Framework - Func
Open Source System Administration Framework - Func
 
Danga::Socketの非同期処理の仕組みとPerlbalで非同期処理するプラグインを書く方法
Danga::Socketの非同期処理の仕組みとPerlbalで非同期処理するプラグインを書く方法Danga::Socketの非同期処理の仕組みとPerlbalで非同期処理するプラグインを書く方法
Danga::Socketの非同期処理の仕組みとPerlbalで非同期処理するプラグインを書く方法
 
YAPC Asia 2010 30days Albumの裏側 後日談
YAPC Asia 2010 30days Albumの裏側 後日談YAPC Asia 2010 30days Albumの裏側 後日談
YAPC Asia 2010 30days Albumの裏側 後日談
 
Inside Sqale's Backend at YAPC::Asia Tokyo 2012
Inside Sqale's Backend at YAPC::Asia Tokyo 2012Inside Sqale's Backend at YAPC::Asia Tokyo 2012
Inside Sqale's Backend at YAPC::Asia Tokyo 2012
 
Puppet Best Practices? at COOKPAD
Puppet Best Practices? at COOKPADPuppet Best Practices? at COOKPAD
Puppet Best Practices? at COOKPAD
 
Inside Sqale's Backend at Sapporo Ruby Kaigi 2012
Inside Sqale's Backend at Sapporo Ruby Kaigi 2012Inside Sqale's Backend at Sapporo Ruby Kaigi 2012
Inside Sqale's Backend at Sapporo Ruby Kaigi 2012
 
Serverspec at July Tech Festa 2013
Serverspec at July Tech Festa 2013Serverspec at July Tech Festa 2013
Serverspec at July Tech Festa 2013
 

Similar to How Danga::Socket handles asynchronous processing and how to write asynchronous Perlbal plugins

Please look at the attach See.doc. I am getting this error all th.docx
Please look at the attach See.doc. I am getting this error all th.docxPlease look at the attach See.doc. I am getting this error all th.docx
Please look at the attach See.doc. I am getting this error all th.docx
randymartin91030
 
Psgi Plack Sfpm
Psgi Plack SfpmPsgi Plack Sfpm
Psgi Plack Sfpm
som_nangia
 
Psgi Plack Sfpm
Psgi Plack SfpmPsgi Plack Sfpm
Psgi Plack Sfpm
wilburlo
 
Yapc::Asia 2008 Tokyo - Easy system administration programming with a framewo...
Yapc::Asia 2008 Tokyo - Easy system administration programming with a framewo...Yapc::Asia 2008 Tokyo - Easy system administration programming with a framewo...
Yapc::Asia 2008 Tokyo - Easy system administration programming with a framewo...
Gosuke Miyashita
 
Writing Prefork Workers / Servers
Writing Prefork Workers / ServersWriting Prefork Workers / Servers
Writing Prefork Workers / Servers
Kazuho Oku
 
course slides -- powerpoint
course slides -- powerpointcourse slides -- powerpoint
course slides -- powerpoint
webhostingguy
 

Similar to How Danga::Socket handles asynchronous processing and how to write asynchronous Perlbal plugins (20)

Flow based programming in golang
Flow based programming in golangFlow based programming in golang
Flow based programming in golang
 
Node.js: CAMTA Presentation
Node.js: CAMTA PresentationNode.js: CAMTA Presentation
Node.js: CAMTA Presentation
 
Tatsumaki
TatsumakiTatsumaki
Tatsumaki
 
Please look at the attach See.doc. I am getting this error all th.docx
Please look at the attach See.doc. I am getting this error all th.docxPlease look at the attach See.doc. I am getting this error all th.docx
Please look at the attach See.doc. I am getting this error all th.docx
 
JUDCon London 2011 - Bin packing with drools planner by example
JUDCon London 2011 - Bin packing with drools planner by exampleJUDCon London 2011 - Bin packing with drools planner by example
JUDCon London 2011 - Bin packing with drools planner by example
 
Psgi Plack Sfpm
Psgi Plack SfpmPsgi Plack Sfpm
Psgi Plack Sfpm
 
Psgi Plack Sfpm
Psgi Plack SfpmPsgi Plack Sfpm
Psgi Plack Sfpm
 
ReactPHP
ReactPHPReactPHP
ReactPHP
 
Plack - LPW 2009
Plack - LPW 2009Plack - LPW 2009
Plack - LPW 2009
 
Yapc::Asia 2008 Tokyo - Easy system administration programming with a framewo...
Yapc::Asia 2008 Tokyo - Easy system administration programming with a framewo...Yapc::Asia 2008 Tokyo - Easy system administration programming with a framewo...
Yapc::Asia 2008 Tokyo - Easy system administration programming with a framewo...
 
Finagle and Java Service Framework at Pinterest
Finagle and Java Service Framework at PinterestFinagle and Java Service Framework at Pinterest
Finagle and Java Service Framework at Pinterest
 
Catalyst MVC
Catalyst MVCCatalyst MVC
Catalyst MVC
 
PSGI and Plack from first principles
PSGI and Plack from first principlesPSGI and Plack from first principles
PSGI and Plack from first principles
 
Phpconf 2013 - Agile Telephony Applications with PAMI and PAGI
Phpconf 2013 - Agile Telephony Applications with PAMI and PAGIPhpconf 2013 - Agile Telephony Applications with PAMI and PAGI
Phpconf 2013 - Agile Telephony Applications with PAMI and PAGI
 
Writing Prefork Workers / Servers
Writing Prefork Workers / ServersWriting Prefork Workers / Servers
Writing Prefork Workers / Servers
 
course slides -- powerpoint
course slides -- powerpointcourse slides -- powerpoint
course slides -- powerpoint
 
WebTalk - Implementing Web Services with a dedicated Java daemon
WebTalk - Implementing Web Services with a dedicated Java daemonWebTalk - Implementing Web Services with a dedicated Java daemon
WebTalk - Implementing Web Services with a dedicated Java daemon
 
Multithreading in PHP
Multithreading in PHPMultithreading in PHP
Multithreading in PHP
 
Intro to PSGI and Plack
Intro to PSGI and PlackIntro to PSGI and Plack
Intro to PSGI and Plack
 
Writing Pluggable Software
Writing Pluggable SoftwareWriting Pluggable Software
Writing Pluggable Software
 

More from Gosuke Miyashita

NoSQLに関するまとめ
NoSQLに関するまとめNoSQLに関するまとめ
NoSQLに関するまとめ
Gosuke Miyashita
 
Maglica - A Simple Internal Cloud Tool at #techkayac
Maglica - A Simple Internal Cloud Tool at #techkayacMaglica - A Simple Internal Cloud Tool at #techkayac
Maglica - A Simple Internal Cloud Tool at #techkayac
Gosuke Miyashita
 
Inside Sqale's Backend at RubyConf Taiwan 2012
Inside Sqale's Backend at RubyConf Taiwan 2012Inside Sqale's Backend at RubyConf Taiwan 2012
Inside Sqale's Backend at RubyConf Taiwan 2012
Gosuke Miyashita
 
Ia型超新星とチャンドラセカール限界
Ia型超新星とチャンドラセカール限界Ia型超新星とチャンドラセカール限界
Ia型超新星とチャンドラセカール限界
Gosuke Miyashita
 
Xen Summit 2008 Tokyo - Operating Xen domains through LL(Perl/Python) with li...
Xen Summit 2008 Tokyo - Operating Xen domains through LL(Perl/Python) with li...Xen Summit 2008 Tokyo - Operating Xen domains through LL(Perl/Python) with li...
Xen Summit 2008 Tokyo - Operating Xen domains through LL(Perl/Python) with li...
Gosuke Miyashita
 
関西オープンソース 2008 30days Albumの裏側
関西オープンソース 2008 30days Albumの裏側関西オープンソース 2008 30days Albumの裏側
関西オープンソース 2008 30days Albumの裏側
Gosuke Miyashita
 
How To Build A Scalable Storage System with OSS at TLUG Meeting 2008/09/13
How To Build A Scalable Storage System with OSS at TLUG Meeting 2008/09/13How To Build A Scalable Storage System with OSS at TLUG Meeting 2008/09/13
How To Build A Scalable Storage System with OSS at TLUG Meeting 2008/09/13
Gosuke Miyashita
 

More from Gosuke Miyashita (16)

Walter ファミリーの紹介 at Shibuya.go#1
Walter ファミリーの紹介 at Shibuya.go#1Walter ファミリーの紹介 at Shibuya.go#1
Walter ファミリーの紹介 at Shibuya.go#1
 
Serverspec at Testing Framework Meeting
Serverspec at Testing Framework MeetingServerspec at Testing Framework Meeting
Serverspec at Testing Framework Meeting
 
Serverspec at hbstudy #45
Serverspec at hbstudy #45Serverspec at hbstudy #45
Serverspec at hbstudy #45
 
NoSQLに関するまとめ
NoSQLに関するまとめNoSQLに関するまとめ
NoSQLに関するまとめ
 
イベント駆動プログラミングとI/O多重化
イベント駆動プログラミングとI/O多重化イベント駆動プログラミングとI/O多重化
イベント駆動プログラミングとI/O多重化
 
Maglica - A Simple Internal Cloud Tool at #techkayac
Maglica - A Simple Internal Cloud Tool at #techkayacMaglica - A Simple Internal Cloud Tool at #techkayac
Maglica - A Simple Internal Cloud Tool at #techkayac
 
DevOps とは何か 何であるべきか
DevOps とは何か 何であるべきかDevOps とは何か 何であるべきか
DevOps とは何か 何であるべきか
 
Inside Sqale's Backend at RubyConf Taiwan 2012
Inside Sqale's Backend at RubyConf Taiwan 2012Inside Sqale's Backend at RubyConf Taiwan 2012
Inside Sqale's Backend at RubyConf Taiwan 2012
 
Ia型超新星とチャンドラセカール限界
Ia型超新星とチャンドラセカール限界Ia型超新星とチャンドラセカール限界
Ia型超新星とチャンドラセカール限界
 
How Perl Changed My Life
How Perl Changed My LifeHow Perl Changed My Life
How Perl Changed My Life
 
10分でわかるDevOps
10分でわかるDevOps10分でわかるDevOps
10分でわかるDevOps
 
DevOpsって何?
DevOpsって何?DevOpsって何?
DevOpsって何?
 
Puppetのススメ
PuppetのススメPuppetのススメ
Puppetのススメ
 
Xen Summit 2008 Tokyo - Operating Xen domains through LL(Perl/Python) with li...
Xen Summit 2008 Tokyo - Operating Xen domains through LL(Perl/Python) with li...Xen Summit 2008 Tokyo - Operating Xen domains through LL(Perl/Python) with li...
Xen Summit 2008 Tokyo - Operating Xen domains through LL(Perl/Python) with li...
 
関西オープンソース 2008 30days Albumの裏側
関西オープンソース 2008 30days Albumの裏側関西オープンソース 2008 30days Albumの裏側
関西オープンソース 2008 30days Albumの裏側
 
How To Build A Scalable Storage System with OSS at TLUG Meeting 2008/09/13
How To Build A Scalable Storage System with OSS at TLUG Meeting 2008/09/13How To Build A Scalable Storage System with OSS at TLUG Meeting 2008/09/13
How To Build A Scalable Storage System with OSS at TLUG Meeting 2008/09/13
 

Recently uploaded

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 

Recently uploaded (20)

Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
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
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
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
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 

How Danga::Socket handles asynchronous processing and how to write asynchronous Perlbal plugins

  • 1. YAPC::Asia 2009 Tokyo 2009/9/10 Gosuke Miyashita
  • 2.
  • 3.  
  • 4.  
  • 5.
  • 6.  
  • 7.
  • 8.
  • 9.
  • 10. Eaxmple of main loop Process timers Wait I/O events Process I/O events Post main loop process
  • 11.  
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19. Main loop(again) Process Timers Wait I/O events Process I/O events Post main loop process
  • 20.  
  • 21. Perlbal mechanism(as reverse proxy) BackendHTTP ClientProxy TCPListener Client Server ClientProxy Client BackendHTTP Danga::Socket based objects
  • 22. Perlbal with a plugin (on start_proxy_request hook) BackendHTTP ClientProxy TCPListener Client Server Plugin::Hoge Target of this session
  • 23.  
  • 24.
  • 25. In case of a synchronous plugin ClientProxy TCPListener Client Server Plugin::Sync Client
  • 26. In case of an asynchronous plugin ClientProxy TCPListener Client Server Plugin::Async Client ClientProxy
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33. In case of “return 0” BackendHTTP ClientProxy TCPListener Client Server Plugin::Async Go to next step even if Plugin::Async is not finished
  • 34. “ return 1” & “call back” BackendHTTP ClientProxy TCPListener Client Plugin::Async Stop the process and go to main loop Server return 1 call back
  • 35.
  • 36.
  • 37.
  • 38.  
  • 39.
  • 40.