7 parse(empty, "+PONG") ->
13 parse(empty, "-" ++ Message) ->
15 parse(empty, "$-1") ->
17 parse(empty, "*-1") ->
19 parse(empty, "$" ++ BulkSize) ->
20 {read, list_to_integer(BulkSize)};
21 parse(read, "$" ++ BulkSize) ->
22 {read, list_to_integer(BulkSize)};
23 parse(empty, "*" ++ MultiBulkSize) ->
24 {hold, list_to_integer(MultiBulkSize)};
25 parse(empty, Message) ->
28 convert(":" ++ Message) ->
29 list_to_integer(Message);
30 % in case the message is not OK or PONG it's a
31 % real value that we don't know how to convert
32 % to an atom, so just pass it as is and remove
34 convert("+" ++ Message) ->