A processing model to implement nonbloking server
It is verey common in HTTP
It merges Middlewares and View
- Process
- Unit
- Dataflow
Process is a php function
Unit is a list of process.
An unit add a login and flow to process.
Default flow is sequensial, so, all process executed sequensially.
You may label a process for an special goal.
Build in label:
- condition: jumbs to the end of unit if the return value is false.
Note: condition processes are not joined to the data flow, but handnle flows.
TO send data to the successor processes a container is used.
Each process can access resources which produced in previus process.
The backward data flow is generated by return values.
composer install pluf/scion
Create a simple index.php
add the following code
<?php
$unitTracker = new UnitTracker([
function($a, $b){
return $a+$b;
}
]);
echo 'result is:' . $unitTracker->doProcess(['a'=>1, 'b'=>4]);
run the code
php index.php
The resullt will be:
$>php index.php
result is: 5
$>
Learn more at these links:
Please see CONTRIBUTING for details.
This project exists thanks to all the people who contribute. Contribute.