This repository contains an application that allows to solve the same problem using lineal programming, parallel programming and concurrent programming.
[TOC]
This repository contains a dockerized environment for building PHP applications based on php:8.4.11-fpm-alpine with Caddy support.
- Unified environment to build CLI, web applications, and/or micro-services based on PHP 8.
- Multi-stage Dockerfile allows you to create optimized development or production-ready Docker images.
- Uses Caddy webserver.
- Self-signed local domains thanks to Caddy.
- Everything on separated Docker services.
- Uses RabbitMQ.
This repository is based on Dockerized PHP, a lightweight dockerized environment to build PHP applications.
Just clone the repository into your preferred path:
$ mkdir -p ~/path/to/my-new-project && cd ~/path/to/my-new-project
$ git clone git@github.com:AlcidesRC/lineal-vs-parallel-vs-concurrent.git .
Important
Kindly examine the README.md
file in the Dockerized PHP repository to understand the build process and start using it.
This application performs an image pixelation based on specific block sizes:
- Generating a new image with multiple areas of 5px x 5px filled with the average color from the source image
- Generating a new image with multiple areas of 10px x 10px filled with the average color from the source image
- Generating a new image with multiple areas of 20px x 20px filled with the average color from the source image
The source code is under the app folder, and follows the Hexagonal Architecture pattern:
.
├── app
│ ├── Concurrent # Concurrent version
│ ├── Lineal # Lineal version
│ ├── Parallel # Parallel version
│ └── Shared
├── composer.json
├── composer.lock
├── LICENSE
├── Makefile
├── phpcs.xml
├── phpstan.neon
├── phpunit.xml
├── public
├── README.md
├── tests
│ ├── Fixtures
│ ├── Integration # Integration tests related with concurrent version
│ │ └── Concurrent
│ └── Unit
│ ├── Concurrent # Unit tests related with concurrent version
│ ├── Lineal # Unit tests related with lineal version
│ ├── Parallel # Unit tests related with parallel version
│ └── Shared
└── vendor
This repository provides a Makefile with relevant steps:
$ make test-lineal
Note
Once the tests are executed, the resultant files are located at src/tests/Fixtures/source_lineal_xxxxx.webp
$ make test-parallel
Note
Once the tests are executed, the resultant files are located at src/tests/Fixtures/source_parallel_xxxxx.webp
$ make test-concurrent
Warning
This test suite only publishes the messages into RabbitMQ.
$ make shell
/var/www/html $ composer start-workers
Once workers complete he consumption, please execute this command to process the result:
$ make shell
/var/www/html $ composer process-result
Please review our security policy on how to report security vulnerabilities:
PLEASE DON'T DISCLOSE SECURITY-RELATED ISSUES PUBLICLY
Only the latest major version receives security fixes.
If you discover a security vulnerability within this project, please open an issue here. All security vulnerabilities will be promptly addressed.
The MIT License (MIT). Please see LICENSE file for more information.