Challenge 2: Sentence Formatting Using RabbitMQ
Explore how to parallelize sentence formatting tasks in PHP using RabbitMQ message brokerage. Learn to implement producers and consumers that handle string transformations and output formatted results efficiently.
We'll cover the following...
Problem statement
Write a program similar to the previous challenge that performs the same formatting on sentences, but this time facilitated by RabbitMQ message brokerage.
Formatting rules
- Remove any dots or underscores from the start.
- Append a period at the end.
- Convert any starting lowercase character to its uppercase version.
Example sentences
Consider the list of sentences below to apply the encoding and the formatting:
Original sentence | Formatted sentence |
they waltered gracefully through the air | They waltered gracefully through the air. |
.melodic rain bounces off the building rooftop. | Melodic rain bounces off the building rooftop. |
__Meteors created a sky-symphony of light | Meteors created a sky-symphony of light. |
Tip: Name your queue
format_sentenceand do any printing to standard output ...