pluf/scion

Nonblocking model to implement HTTP server

7.0.6 2021-02-10 02:06 UTC

This package is auto-updated.

Last update: 2024-04-10 09:14:48 UTC


README

Build Status Total Downloads License

A processing model to implement nonbloking server

It is verey common in HTTP

It merges Middlewares and View

Concepts

  • Process
  • Unit
  • Dataflow

Process

Process is a php function

Unit

Unit is a list of process.

An unit add a login and flow to process.

Default flow is sequensial, so, all process executed sequensially.

Labeled process

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.

Dataflow

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.

How to install

composer install pluf/scion

Quick start

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

Learn more at these links:

Contributors

Please see CONTRIBUTING for details.

Code Contributors

This project exists thanks to all the people who contribute. Contribute.

68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f706c75662f636f6e7472696275746f72732e7376673f77696474683d38393026627574746f6e3d66616c7365