Last Updated | | Ratings | | Unique User Downloads | | Download Rankings |
2024-01-10 (9 months ago) | | 69% | | Total: 487 | | All time: 5,898 This week: 36 |
|
Description | | Author |
This package can process asynchronous I/O in pure PHP like Node.js.
It can register callback functions that are invoked when specific events occur.
The IOLoop class uses the libevent extension to add or remove streams of data or timers to watch and dispatch when relevant events occur.
The packages comes with classes for reading and writing from data streams like files, network sockets and pipes, as a well a dedicated class that works as HTTP server. Innovation Award
April 2015
Winner
Prize: One downloadable e-book of choice by O'Reilly |
Asynchronous programming can be more efficient to execute multiple tasks in parallel that need to wait for I/O operations like accessing files, databases or remote computers.
Node.js made asynchronous programming very popular. This package implements asynchronous programming support in pure PHP very similar to the way Node.js works.
Manuel Lemos |
| |
|
|
Innovation award
Nominee: 2x
Winner: 1x |
|
Details
Plus
An asynchronous I/O environment in pure PHP, in another words, it is a micro nodejs implementation in pure PHP
Example:
> a simple HTTP server using the new HTTPD class
include "Plus.php";
use Plus\Frame;
$frame = new Frame;
$httpd = $frame->httpd();
$httpd->createServer(function($request, $response)
{
$response->writeHead(200, ["Content-Type" => "text/html"]);
$response->write("<!DOCTYPE 'html'>");
$response->write("<html>");
$response->write("<head>");
$response->write("<title>Welcome to Plus http daemon</title>");
$response->write("</head>");
$response->write("<body>");
$response->write("<h1>It works !!</h1>");
$response->write("</body>");
$response->write("</html>");
$response->end();
});
$httpd->listen(80);
$frame->run();
Changelog:
1.0.1
-
added `id` property to the `IOStream` class
-
added `HTTPD` class as our official HTTP Daemon
1.0
initialized
|
Applications that use this package |
|
No pages of applications that use this class were specified.
If you know an application of this package, send a message to the author to add a link here.