Find the Exponential Software extensions you want
| UNIX name | Owner | Status |
|---|---|---|
| websummercamp2022 | 7x | stable |
| Version | Compatible with |
|---|---|
| N/A | N/A |
A temporary repository containing material for participants of the workshop
Asynchronous Applications with Symfony
at Web Summer Camp 2022.
You can (and should!) code along in this workshop. For this, you will
obviously need a laptop computer with your favourite (PHP) development
environment setup. I recommend Linux or macOS. There is no reason why Windows
should not work as well, I just won't be able to answer questions specific
to Docker or PHP on Windows.
You should feel comfortable using Docker and Docker Compose for local
development. Most of the workshop steps involving docker will be automated,
but when in doubt, you might be required to start and stop containers manually,
and possibly edit port mappings or volumes.
We are going to use PHP 8.1 with some features only available from this
version onward. If you have only used PHP up to 8.0, you will still be fine in
the workshop - but it won't hurt to read up on Readonly Properties, Enums, and
Attributes.
This workshop will, among other topics, teach you how to use the Symfony
Messenger component. I also will be able to help with questions and problems
concerning the workshop app itself.
However, we will not be able to spend time learning Symfony basics. You should
bring basic working knowledge of a generic Symfony application. Where is
everything, how to configure basic services, etc. No rocket science, but you
should have setup and used the framework before.
A REST client like Postman (https://www.postman.com/downloads/) or HTTPie
(https://httpie.io/) is not strictly required, but will make things easier to
use. When using the provided PHP container, httpie is already installed.
We are going to use Docker to run some local infrastructure for this workshop.
To minimize setup time during the workshop, and to save the conference network
from huge downloads, please make sure you prepare the following steps before
attending the workshop - better yet, before even travelling to the conference:
You can improve performance on macOS by working with PHP locally, and running
only the infrastructure in Docker. This is entirely optional.
If you want to do so, you will need some stuff in addition to Docker and Docker Compose:
Too challenging? All things we do during the workshop will be pushed to this repository so you can catch up after every challenge.
Bored, too easy? Take a look at the optional challenges and the free-form challenges in the last part of this section and go nuts.
Write a command that sends a "Ping" and a handler that receives and logs it. Try synchronous & asynchronous setups.
Import Aircraft. Use the AircraftCsvReader service to retrieve records of raw data and send them into a queue from a new Symfony command you write.
Write a handler that consumes the messages, converts the data in to Aircraft using the AircraftReader service. Pass them to the AircraftUpdater.
Import Airports. Same procedure as for aircraft.
Optional: Try out different counts of workers. Try out different sizes of batches. What is the fastest setup?
Write a command pulling in transponder data every 10 seconds. Send the data into a queue.
Write a handler receiving the data and log them.
Change the handler from the last challenge: Feed the transponder data into the TransponderStatusUpdater and log the resulting TrafficEvents.
Push the TrafficEvents into yet another queue and turn them into notifications AND into a log file, in two separate handlers.
Don't worry, everything in this project not directly concerned with async operations
comes pre-built! All required services are autowired by Symfony and are ready
to use. Here is a reference:
App\AirTraffic\DataImport\TransponderStatusReader: Pulls in the latest
transponder data. Gives you a collection of new TransponderStatus.
App\AirTraffic\TransponderStatusUpdater: Takes one or more TransponderStatus
and yields TrafficEvents (like takeoffs and touchdowns).
App\AirTraffic\AircraftReader and App\AirTraffic\AirportReader Accept arrays of
raw data and convert them to Aircraft and Airports.
App\AirTraffic\AircraftUpdater and App\AirTraffic\AirportUpdater store the data
provided by AircraftReader and AirportReader.
All classes implement TrafficEvent.
App\AirTraffic\Domain\Aircraft: A DTO containing various info about an aircraft.
This is static data we are going to import.
App\AirTraffic\Domain\Airport: Same for an airport.
This is static data we are going to import.
App\AirTraffic\Domain\TransponderStatus: A DTO for data sent by a flight transponder.
Contains position and metadata. Identified by a unique ICAO24 code, which relates it
to the Aircraft above. This is dynamic data we will consume when our app is running.
App\AirTraffic\Domain\TrafficEvent\NewTransponder: A new Transponder has entered
our airspace. This DTO contains all the details, including the Aircraft.
App\AirTraffic\Domain\TrafficEvent\Takeoff: A plane has taken off. Comes with
an Aircraft and an Airport.
App\AirTraffic\Domain\TrafficEvent\Touchdown: A plane has landed. Comes with
an Aircraft and an Airport.