This repository has been archived by the owner on Jun 11, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Better organization of Websocket modules
- Loading branch information
1 parent
197adf2
commit 2e76ba4
Showing
7 changed files
with
32 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
defmodule Helix.Websocket.Request.Relay do | ||
@moduledoc """ | ||
`RequestRelay` is a struct intended to be relayed all the way from the Request | ||
to the Public to the ActionFlow, so it can be used by `Helix.Event` to | ||
identify the `request_id` and create a meaningful stacktrace. | ||
""" | ||
|
||
defstruct [:request_id] | ||
|
||
@type t :: t_of_type(binary) | ||
|
||
@type t_of_type(type) :: | ||
%__MODULE__{ | ||
request_id: type | ||
} | ||
|
||
@spec new(map) :: | ||
t | ||
| t_of_type(nil) | ||
def new(%{"request_id" => request_id}) when is_binary(request_id) do | ||
%__MODULE__{ | ||
request_id: request_id | ||
} | ||
end | ||
def new(_), | ||
do: %__MODULE__{} | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.