PHP Classes

PHP Multiplexed I/O: Manage multiple simultaneous network connections

Recommend this page to a friend!
     
  Info   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStarStar 62%Total: 1,112 All time: 3,383 This week: 488Up
Version License PHP version Categories
phpmio 0.1BSD License5.2Networking, PHP 5, Files and Folders
Description 

Author

This package can be used to manage multiple simultaneous network connections or file accesses. It is loosely based on the selectable channels implementation from Java's NIO package.

It can create streams to access files, access network servers or accept connections from network clients.

The streams can be set to non-blocking mode, so this package can manage the access to data read or written to multiple streams simultaneously.

It can register selectors for all the streams, so it can wait and handle the data read or written to multiple streams when it is ready.

Innovation Award
PHP Programming Innovation award nominee
April 2007
Number 4
Some applications require retrieving information from many sources, like files or remote network connections.

Using synchronous access, a regular script can only access one data source at a time. If a script needs to poll multiple sources, not only it may take a lot of time, but waiting from one source to respond may halt the script forever.

An alternative approach to retrieve data from many sources is to use asynchronous access to poll many sources at the same time. This way it does not block the applications from doing parallel processing while waiting for the data to come.

This package provides a solution that uses non-blocking streams to provide simultaneous access to multiple files or network connections for any PHP application.

Manuel Lemos
Picture of Robert Young
Name: Robert Young <contact>
Classes: 2 packages by
Country: United Kingdom
Age: 44
All time rank: 197986 in United Kingdom
Week rank: 214 Up13 in United Kingdom Up
Innovation award
Innovation award
Nominee: 2x

  Files folder image Files (11)  
File Role Description
Files folder imageexample (2 files)
Files folder imagetests (4 files)
Plain text file Exception.php Class Exception classes
Plain text file SelectionKey.php Class Contains the SelectionKey class
Plain text file Selector.php Class Contains the Selector class
Plain text file Stream.php Class Contains the Stream class
Plain text file StreamFactory.php Class Contains the StreamFactory class

  Files folder image Files (11)  /  example  
File Role Description
  Accessible without login Plain text file downloader.php Example Example of downloading multiple files
  Accessible without login Plain text file riddler.php Example Self contained example

  Files folder image Files (11)  /  tests  
File Role Description
  Accessible without login Plain text file SelectionKeyTest.php Test Unit test for SelectionKey class
  Accessible without login Plain text file SelectorTest.php Test Unit test for Selector class
  Accessible without login Plain text file StreamFactoryTest.php Test Unit test for StreamFactory class
  Accessible without login Plain text file StreamTest.php Test Unit test for StreamTest

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 0%
Total:1,112
This week:0
All time:3,383
This week:488Up
 User Ratings  
 
 All time
Utility:79%StarStarStarStar
Consistency:79%StarStarStarStar
Documentation:-
Examples:79%StarStarStarStar
Tests:75%StarStarStarStar
Videos:-
Overall:62%StarStarStarStar
Rank:873