Skip to content

Commit d03dc6b

Browse files
committed
fix io examples
1 parent 2eb29f1 commit d03dc6b

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

chapters/io.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@ Received data: 14
504504
Received data: 16
505505
Received data: 18
506506
Received data: 20
507-
[timepout,2,4,6,8,10,12,14,16,18]
507+
[timeout,2,4,6,8,10,12,14,16,18]
508508
```
509509
We see that the first 5 messages are not asyncronous, but the last 5 are. This is because the port is busy and the send operation is blocking. The port is busy because the id of the message is below 14 and the call is to the `bar` function. The port is busy for 5 seconds and then the last 5 messages are sent asyncronously.
510510

code/io_chapter/pg_example/src/busy_port.erl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ async_receive() ->
4848
receive
4949
{busy_port_example, Data} ->
5050
Data
51-
after 2000 -> timepout
51+
after 2000 -> timeout
5252
end.
5353

5454
call_port(Msg) ->

code/io_chapter/pg_example/src/pg_router.erl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ stop() ->
1313
dispatch() ->
1414
[
1515
{"/websocket", websocket_handler, []},
16-
{"/[...]", cowboy_static, {priv_dir, my_app, "static"}}
16+
{"/[...]", cowboy_static, {priv_dir, pg_example, "static"}}
1717
].

0 commit comments

Comments
 (0)