asynchronous php myth? reality!
DESCRIPTION
Asynchronous PHP Myth? Reality!. Alexander Lisachenko, Head of Sowtware Architecture at Alpari (RU). About me. About me. Technology Evolution. Technology Evolution. What should we expect in the nearest future?. Technology trends. PHP World. Simple example. What if sharding ?. - PowerPoint PPT PresentationTRANSCRIPT
Asynchronous PHPMyth? Reality!
Alexander Lisachenko, Head of Sowtware Architecture at Alpari (RU)
About me
About me
Technology Evolution
Technology Evolution
What should we expectin the nearest future?
Technology trends
PHP World
Simple example
What if sharding?
What if unavailable?
Highload?
Blocking IO
What is the solution?
Asynchronous PHP
One-way SOAP call
One-way SOAP call
No output is defined for the operation
One-way SOAP call
Works only in WSDL-mode, so need an WSDL (Zend_AutoDiscover):
Only “input” part is defined for one-way call
One-way SOAP call – client side
CLI tools
Processes
Processes. Elementary
Processes. Intermediate
Non-blocking stream, we can query it later asynchronously
with stream_select()
Processes. Intermediate
stream_select() goodness
POSIX signals
Processes. POSIX signals
Processes. POSIX signals
Signal handling issue in the code
PHP will hang until loop is finished and will ignore signals
Asynchronous signal handling
Enable support for tick handler and async signal
handling.
Asynchronous PHP. Enterprise way.
Asynchronous PHP. Enterprise way.
PHP App1PHP App1
PHP App2PHP App2
PHP App3PHP App3
PHP App4PHP App4
PHP App5PHP App5
PHP App6PHP App6
STOMP, WebSocket,
AMQP
Publishers Subscribers
Asynchronous PHP. Enterprise way.
Asynchronous PHP. Enterprise way.
Asynchronous data access in PHP
Asynchronous data access in PHP
Like typical stream_select() call
Asynchronous PHP. Cutting-edge.
Asynchronous PHP. Cutting-edge.
True threads in PHP!
Just call a function in the separate thread
Thread syncrhronization
Asynchronous PHP. Cutting-edge.
yields a thread-coroutine
Asynchronous PHP. Cutting-edge.
Threaded asynchronous socket server
Non-blocking server
Effective epoll() loop in libevent
Our threaded server
Threaded asynchronous socket server
Non-blocking connection
Threaded asynchronous socket server
Separate loop for each connection
Each connection is handled in separate
thread
Thanks! Questions?
Alexander Lisachenko
Twitter: https://twitter.com/lisachenkoGithub: https://github.com/lisachenko