Remove websocket endpoint
This commit is contained in:
parent
07793041b6
commit
33599d888d
2 changed files with 0 additions and 32 deletions
|
@ -1,10 +1,5 @@
|
||||||
import gleam/dict.{type Dict}
|
import gleam/dict.{type Dict}
|
||||||
import gleam/dynamic/decode.{type Decoder}
|
import gleam/dynamic/decode.{type Decoder}
|
||||||
import gleam/erlang/process.{type Subject}
|
|
||||||
import gleam/http/request
|
|
||||||
import gleam/option
|
|
||||||
import gleam/otp/actor
|
|
||||||
import stratus
|
|
||||||
import utils/api.{type ApiResponse}
|
import utils/api.{type ApiResponse}
|
||||||
import utils/auth.{type AgentToken, AgentAuth}
|
import utils/auth.{type AgentToken, AgentAuth}
|
||||||
|
|
||||||
|
@ -31,28 +26,3 @@ pub fn get_supply_chain(
|
||||||
_ -> api.parse_error_response(response)
|
_ -> api.parse_error_response(response)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn get_departure_events(
|
|
||||||
token: AgentToken,
|
|
||||||
initial_state: state,
|
|
||||||
on_message: fn(state, stratus.Message(user)) ->
|
|
||||||
Result(state, process.ExitReason),
|
|
||||||
on_close: fn(state) -> Nil,
|
|
||||||
) -> Result(Subject(stratus.InternalMessage(user)), actor.StartError) {
|
|
||||||
stratus.websocket(
|
|
||||||
request: api.get(AgentAuth(token), "/my/socket.io")
|
|
||||||
|> request.set_body(""),
|
|
||||||
init: fn() { #(initial_state, option.None) },
|
|
||||||
loop: fn(msg, state, conn) {
|
|
||||||
case on_message(state, msg) {
|
|
||||||
Ok(state) -> actor.continue(state)
|
|
||||||
Error(reason) -> {
|
|
||||||
let _ = stratus.close(conn)
|
|
||||||
actor.Stop(reason)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
)
|
|
||||||
|> stratus.on_close(on_close)
|
|
||||||
|> stratus.initialize
|
|
||||||
}
|
|
||||||
|
|
|
@ -133,8 +133,6 @@ pub const get_shipyard = systems.get_shipyard
|
||||||
|
|
||||||
pub const get_supply_chain = data.get_supply_chain
|
pub const get_supply_chain = data.get_supply_chain
|
||||||
|
|
||||||
pub const get_departure_events = data.get_departure_events
|
|
||||||
|
|
||||||
pub const get_server_status = global.get_server_status
|
pub const get_server_status = global.get_server_status
|
||||||
|
|
||||||
pub const list_error_codes = global.list_error_codes
|
pub const list_error_codes = global.list_error_codes
|
||||||
|
|
Loading…
Reference in a new issue