shimmer/ws/event_loop

Types

pub type IdentifyInfo {
  IdentifyInfo(token: String, intents: Int)
}

Constructors

  • IdentifyInfo(token: String, intents: Int)
pub type Message {
  HeartbeatNow
  Frame(String)
}

Constructors

  • HeartbeatNow
  • Frame(String)
pub type Spec {
  Spec(
    init: fn() -> State,
    handle_message: fn(Message, State) -> State,
  )
}

Constructors

  • Spec(
      init: fn() -> State,
      handle_message: fn(Message, State) -> State,
    )
pub type State {
  State(
    heartbeat_interval: Int,
    sequence: Int,
    conn: Connection,
    identify_info: IdentifyInfo,
  )
}

Constructors

  • State(
      heartbeat_interval: Int,
      sequence: Int,
      conn: Connection,
      identify_info: IdentifyInfo,
    )

Functions

pub fn websocket_actor(identify_info: IdentifyInfo) -> Result(
  Pid,
  Dynamic,
)