2017 © Pedro Peláez
 

library io

Non blocking I/O for PHP

image

carica/io

Non blocking I/O for PHP

  • Sunday, March 4, 2018
  • by ThomasWeinert
  • Repository
  • 2 Watchers
  • 23 Stars
  • 937 Installations
  • PHP
  • 3 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 2 Versions
  • 1 % Grown

The README.md

Carica Io

Build Status License Total Downloads Latest Stable Version Latest Unstable Version, (*1)

License: The MIT License, (*2)

Copyright: 2013-2019 Thomas Weinert thomas@weinert.info, (*3)

Carica Io is a collection of experimental php classes and scripts for non-blocking I/O. It provides the basic building blocks for hardware control using Firmata (Arduino) and GPIO (Raspberry PI)., (*4)

Basics

The repository provides the API needed for non-blocking I/O. A simple event loop and event emitter are included. The loop implementation is not performance optimized. However it is possible to use an adapter for ReactPHP or AMPHP., (*5)

It includes an (incomplete) HTTP server that should be enough for the first steps. It supports GET requests and WebSocket connections., (*6)

           +---------------+
           |  Carica\Chip  |
           +-------+-------+
                   ^
                   |
        +----------+----------+
        |                     |
+-------+-------+    +--------+-------+
|  Carica\GPIO  |    | Carica\Firmata |
+-------+-------+    +--------+-------+
        ^                     ^
        |                     |
        +----------+----------+
                   |
           +-------+-------+
           |   Carica\Io   |
           +---------------+

Carica/Io provides the classes for event based programming and a simple web server. It defines interfaces for hardware control (Pin, ShiftOut, ...). Carica/Firmata is a client library for the Firmata protocol it allows to control Arduino boards over a serial or a network connection. Carica/GPIO implements GPIO into PHP using the file system or the WiringPI library for the Raspberry PI., (*7)

Carica/Chip implements classes for hardware objects. Like a LED, a RGB-LED, a Servo,..., (*8)

Usage

You will need to get the loop instance from the factory, attach events and run it., (*9)

$loop = Carica\Io\Event\Loop\Factory::get();
$loop->setInterval(
  static function () {
    static $i = 0;
    echo $i++;
  },
  1000
);
$loop->run();

The Versions

04/03 2018

dev-master

9999999-dev https://github.com/ThomasWeinert/carica-io

Non blocking I/O for PHP

  Sources   Download

MIT

The Requires

  • php >=7.1

 

by Thomas Weinert

non-blocking-io asynchronous-io

02/03 2018

1.0.0

1.0.0.0 https://github.com/ThomasWeinert/carica-io

Non blocking I/O for PHP

  Sources   Download

MIT

The Requires

  • php >=7.1

 

by Thomas Weinert

non-blocking-io asynchronous-io