gamqp/amqp091/internal/socket

Types

pub type Socket

Mirrors what gamqp_ffi:classify/1 returns for active-mode messages.

pub type SocketEvent {
  SocketData(BitArray)
  SocketClosed
  SocketFailed(String)
  NotSocket
}

Constructors

  • SocketData(BitArray)
  • SocketClosed
  • SocketFailed(String)
  • NotSocket

Values

pub fn activate(socket: Socket) -> Result(Nil, String)

Asks for the next chunk of data as a message to the owning process.

pub fn classify(message: dynamic.Dynamic) -> SocketEvent
pub fn close(socket: Socket) -> Nil
pub fn connect(
  host: String,
  port: Int,
  tls: option.Option(tls.TlsConfig),
  timeout: Int,
) -> Result(Socket, String)
pub fn now() -> Int
pub fn receive(
  socket: Socket,
  timeout: Int,
) -> Result(BitArray, String)
pub fn send(
  socket: Socket,
  data: BitArray,
) -> Result(Nil, String)
pub fn set_owner(
  socket: Socket,
  pid: process.Pid,
) -> Result(Nil, String)
✨ Search Document