You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: basic_pipeline/05_Formats.md
+6-6Lines changed: 6 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,10 @@
1
-
# Formats
1
+
# Stream formats in action
2
2
3
-
Since we have already discussed what caps are and how to use them, let's make use of them in our project!
3
+
Since we have already discussed what stream formats are and how to use them, let's make use of them in our project!
4
4
The first thing to do is to define modules responsible for describing the formats used in our pipeline.
5
5
We will put them in a separate directory - `lib/formats`. Let's start with the format describing the [packets](../glossary/glossary.md#packet):
6
6
7
-
**_`lib/formats/PacketFormat.ex`_**
7
+
**_`lib/formats/packet_format.ex`_**
8
8
9
9
```elixir
10
10
defmoduleBasic.Formats.Packetdo
@@ -15,11 +15,11 @@ defmodule Basic.Formats.Packet do
15
15
end
16
16
```
17
17
18
-
The definition of the module is not complicated, as you can see in the code snippet above - we are only defining a structure within that module, with a `:type` parameter, which default value is `:custom_packtes`.
18
+
The definition of the module is not complicated, as you can see in the code snippet above - we are only defining a structure within that module, with a `:type` parameter, whose default value is `:custom_packets`.
19
19
20
20
In our [pipeline](../glossary/glossary.md#pipeline) we will also send another type of data - [frames](../glossary/glossary.md#frame). Let's define a format for them:
21
21
22
-
**_`lib/formats/FrameFormat.ex`_**
22
+
**_`lib/formats/frame_format.ex`_**
23
23
24
24
```elixir
25
25
defmoduleBasic.Formats.Framedo
@@ -32,7 +32,7 @@ end
32
32
33
33
Same as in the case of the previous format - we are defining a structure with a single field, called `:encoding`, and the default value of that field - `:utf8`.
34
34
35
-
That's it! Format modules are really simple - the more complicated thing is to make use of them - which we will do in the subsequent chapters while defining the caps!
35
+
That's it! Format modules are really simple - the more complicated thing is to make use of them - which we will do in the subsequent chapters while defining the specs!
36
36
37
37
Before advancing you can test the `Source`[element](../glossary/glossary.md/#source), using the tests provided in `/test` directory.
0 commit comments