2017 © Pedro Peláez
 

library conveyor

A convey system for commands and requests

image

chencha/conveyor

A convey system for commands and requests

  • Tuesday, March 31, 2015
  • by jchencha
  • Repository
  • 1 Watchers
  • 0 Stars
  • 20 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 9 Versions
  • 0 % Grown

The README.md

Command and Request Convey System

Basic Usage

Bootstrap Code

$userDbBelt=new UserDbBelt(); //Extends Chencha\Conveyor\Belt
$userDbBelt->registerMachines(SaveInDatabase(), new UpdateElastic()); 

Machines extend \Chencha\Conveyor\Machine, (*1)

$mainConveyor=new Chencha\Conveyor();
$mainConveyor->registerBelt($userBelt);

Running Belt

$userDbBelt =$mainConveyor->makeBelt(UserDbBelt::class);
$subject=new User("email"=>"test@test.com","password"=>"good_password");
$$userDbBelt->run($subject);

$subject->getResponse();
$subject->hasError();
$subject->getErrors();

Processes

Processes are belts that are chained together. To stop a process before the next belt. A StopBeltException should be thrown., (*2)

$userRegistration= new RegistrationProcess();
$userRegistration->registerBelts($userValidation,$userDbBelt); //Ordering is important
$mainConveyor->registerProcess($userRegistration);

Running a process

$userRegistrationProcess=$mainConveyor->makeProcess(RegistrationProcess::class);
$userRegistrationProcess->run($user);

Exception

StopProcessException //This exceptions will stop the process before next belt is run

All other exceptions bubble up immediately, (*3)

Deploy status

This system is not ready for production use changes expected coming days

Examples

To check the examples please see, (*4)

  • examples/process_example.php
  • examples/belt_example.php

The Versions

31/03 2015

dev-develop

dev-develop

A convey system for commands and requests

  Sources   Download

MIT

The Requires

 

by Chencha Jacob

31/03 2015

dev-master

9999999-dev

A convey system for commands and requests

  Sources   Download

MIT

The Requires

 

by Chencha Jacob

31/03 2015

0.1.6

0.1.6.0

A convey system for commands and requests

  Sources   Download

MIT

The Requires

 

by Chencha Jacob

30/03 2015

0.1.5

0.1.5.0

A convey system for commands and requests

  Sources   Download

MIT

The Requires

 

by Chencha Jacob

17/03 2015

0.1.4

0.1.4.0

A convey system for commands and requests

  Sources   Download

MIT

The Requires

 

by Chencha Jacob

17/03 2015

0.1.3

0.1.3.0

A convey system for commands and requests

  Sources   Download

MIT

The Requires

 

by Chencha Jacob

17/03 2015

0.1.2

0.1.2.0

A convey system for commands and requests

  Sources   Download

MIT

The Requires

 

by Chencha Jacob

17/03 2015

0.1.1

0.1.1.0

A convey system for commands and requests

  Sources   Download

MIT

The Requires

 

by Chencha Jacob

09/03 2015

0.1.0

0.1.0.0

A convey system for commands and requests

  Sources   Download

MIT

The Requires

 

by Chencha Jacob