Skip to content
This repository was archived by the owner on Jun 25, 2025. It is now read-only.

Commit 62e151d

Browse files
committed
Fixed readme format
1 parent afc753e commit 62e151d

File tree

1 file changed

+24
-24
lines changed

1 file changed

+24
-24
lines changed

README.md

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -35,34 +35,34 @@ performance, we mean about CPU consumption, Memory usage and Response times.
3535
Everything matters here, right? At least, everything should matter in terms of
3636
software economy.
3737

38-
**Step 1** - Apache server receives a new request and sends it directly to the
38+
- **Step 1** - Apache server receives a new request and sends it directly to the
3939
app.php file.
40-
**Step 2** - Symfony kernel boots. That means that, in the better of the cases, the
40+
- **Step 2** - Symfony kernel boots. That means that, in the better of the cases, the
4141
container is cached properly. The Kernel is created *(once again)*, the
4242
container configuration is loaded from this cache, and a new Request object is
4343
created with the data received from Apache.
44-
**Step 3** - The Kernel handles this Request, waiting for a Response.
45-
**Step 4** - Some framework magic (resolve controller, resolve dispatch some
44+
- **Step 3** - The Kernel handles this Request, waiting for a Response.
45+
- **Step 4** - Some framework magic (resolve controller, resolve dispatch some
4646
events...)
47-
**Step 5** - We call the controller entry point. Remember that we MUST return a
47+
- **Step 5** - We call the controller entry point. Remember that we MUST return a
4848
Response instance (remember that we don't use Views here, so we discard
4949
returning an array here. Anyway, would be the same).
50-
**Step 6** - We do our logic. For example, we call a repository to get an array of
50+
- **Step 6** - We do our logic. For example, we call a repository to get an array of
5151
values from Redis.
52-
**Step 7** - Redis returns an array of values, where the controller return a new
52+
- **Step 7** - Redis returns an array of values, where the controller return a new
5353
Response with these values, where the Kernel, after some extra event dispatches,
5454
return this Response to Apache, which return the response to the final client.
5555

5656
This is one natural Request / Response workflow in one of our applications.
5757
Fast, isn't it? Let's check in terms of performance.
5858

59-
**Step 1** - We must have Apache server installed. By adding Apache as a man in
59+
- **Step 1** - We must have Apache server installed. By adding Apache as a man in
6060
the middle, we spend some time. Even if it's **1ms**, we will see later that
6161
each single **1ms** can be so much important here.
62-
**Step 2** - Symfony kernel is booted every time. Once and again. Every single
62+
- **Step 2** - Symfony kernel is booted every time. Once and again. Every single
6363
request. Let's say... **15ms**? **20ms?** Something like that. Let's say
6464
**15ms** being SO optimists.
65-
**Step 7** - Imagine a Redis call as a representation of any external call. This
65+
- **Step 7** - Imagine a Redis call as a representation of any external call. This
6666
could be a redis one (fast one), or an HTTP one, slow one. This action will
6767
last the time this operation lasts. Let's say **50ms**.
6868

@@ -135,18 +135,18 @@ with some non-blocking clients like the HTTP one or a Redis one.
135135

136136
This is the workflow.
137137

138-
**Step 1** - ReactPHP receives it's own Request, and creates a Symfony request.
139-
**Step 2** - The Kernel handles this Request, waiting for a Response.
140-
**Step 3** - Some framework magic (resolve controller, resolve dispatch some
138+
- **Step 1** - ReactPHP receives it's own Request, and creates a Symfony request.
139+
- **Step 2** - The Kernel handles this Request, waiting for a Response.
140+
- **Step 3** - Some framework magic (resolve controller, resolve dispatch some
141141
events...)
142-
**Step 4** - We call the controller entry point. Remember that we MUST return a
142+
- **Step 4** - We call the controller entry point. Remember that we MUST return a
143143
Response instance.
144-
**Step 5** - We do our logic. For example, we call a repository to get an array
144+
- **Step 5** - We do our logic. For example, we call a repository to get an array
145145
of values from Redis.
146-
**Step 6** - Redis returns a **Promise** of values. This promise is returned to
146+
- **Step 6** - Redis returns a **Promise** of values. This promise is returned to
147147
the controller, and has to be resolved. Once is resolved, returns a Response to
148148
the Kernel.
149-
**Step 7** - The Kernel returns the Response to the ReactPHP server, which
149+
- **Step 7** - The Kernel returns the Response to the ReactPHP server, which
150150
creates a new promise with that Response.
151151

152152
When checking performance, we see that the I/O, even if it's asynchronous, is
@@ -163,19 +163,19 @@ to the ReactPHP server.
163163

164164
Let's check the workflow.
165165

166-
**Step 1** - ReactPHP receives it's own Request, and creates a Symfony request.
167-
**Step 2** - The Kernel handles **asynchronously** this Request, waiting for a
166+
- **Step 1** - ReactPHP receives it's own Request, and creates a Symfony request.
167+
- **Step 2** - The Kernel handles **asynchronously** this Request, waiting for a
168168
Promise containing a Response.
169-
**Step 3** - Some framework magic (resolve controller, resolve dispatch some
169+
- **Step 3** - Some framework magic (resolve controller, resolve dispatch some
170170
events...)
171-
**Step 4** - We call the controller entry point. Now we can return a Promise
171+
- **Step 4** - We call the controller entry point. Now we can return a Promise
172172
instead of a Response instance.
173-
**Step 5** - We do our logic. For example, we call a repository to get an array
173+
- **Step 5** - We do our logic. For example, we call a repository to get an array
174174
of values from Redis.
175-
**Step 6** - Redis returns a Promise of values. This promise is returned to
175+
- **Step 6** - Redis returns a Promise of values. This promise is returned to
176176
the controller. No need to resolve anything. Returning the Promise to the
177177
Kernel.
178-
**Step 7** - The Kernel returns the Promise to the ReactPHP server. Directly.
178+
- **Step 7** - The Kernel returns the Promise to the ReactPHP server. Directly.
179179

180180
And checking the performance? Easy. The response will still return in 54ms. We
181181
can improve this time by improving your networking interface or by adding some

0 commit comments

Comments
 (0)