gamqp/amqp091/internal/client

The connection process: handshake, channel multiplexing, content reassembly, confirms and heartbeats. See docs/architecture.md.

Types

generation tells a closed channel’s handle apart from a newer channel that reused its id.

pub type Channel {
  Channel(connection: Connection, id: Int, generation: Int)
}

Constructors

  • Channel(connection: Connection, id: Int, generation: Int)
pub type Connection {
  Connection(
    subject: process.Subject(Message),
    pid: process.Pid,
    server_properties: List(#(String, table.FieldValue)),
    channel_max: Int,
    frame_max: Int,
    heartbeat: Int,
    call_timeout: Int,
  )
}

Constructors

Bookkeeping to apply once a method completes.

pub type Hook {
  NoHook
  RegisterConsumer(process.Subject(event.ConsumerMessage))
  RemoveConsumer
  EnableConfirms
}

Constructors

pub type Mechanism {
  Plain
  AmqPlain
  External
}

Constructors

  • Plain
  • AmqPlain
  • External
pub opaque type Message
pub type Reply {
  MethodReply(method.Method)
  GetReply(method.Method, message.Properties, BitArray)
}

Constructors

pub type Settings {
  Settings(
    host: String,
    port: Int,
    username: String,
    password: String,
    virtual_host: String,
    mechanism: Mechanism,
    tls: option.Option(tls.TlsConfig),
    heartbeat: Int,
    frame_max: Int,
    channel_max: Int,
    connection_timeout: Int,
    call_timeout: Int,
    name: option.Option(String),
  )
}

Constructors

  • Settings(
      host: String,
      port: Int,
      username: String,
      password: String,
      virtual_host: String,
      mechanism: Mechanism,
      tls: option.Option(tls.TlsConfig),
      heartbeat: Int,
      frame_max: Int,
      channel_max: Int,
      connection_timeout: Int,
      call_timeout: Int,
      name: option.Option(String),
    )

Values

pub fn add_blocked_listener(
  conn: Connection,
  listener: process.Subject(event.Blocked),
) -> Nil
pub fn add_confirm_listener(
  channel: Channel,
  listener: process.Subject(event.Confirm),
) -> Result(Nil, core.AmqpError)
pub fn call(
  channel: Channel,
  m: method.Method,
  hook: Hook,
) -> Result(Reply, core.AmqpError)
pub fn cast(
  channel: Channel,
  m: method.Method,
  hook: Hook,
) -> Result(Nil, core.AmqpError)
pub fn close(conn: Connection) -> Result(Nil, core.AmqpError)
pub fn open(
  settings: Settings,
) -> Result(Connection, core.AmqpError)
pub fn open_channel(
  conn: Connection,
) -> Result(Channel, core.AmqpError)
pub fn publish(
  channel: Channel,
  m: method.Method,
  properties: message.Properties,
  body: BitArray,
) -> Result(Int, core.AmqpError)
pub fn set_return_listener(
  channel: Channel,
  listener: process.Subject(event.Returned),
) -> Result(Nil, core.AmqpError)
pub fn update_secret(
  conn: Connection,
  secret: String,
  reason: String,
) -> Result(Nil, core.AmqpError)
pub fn wait_for_confirms(
  channel: Channel,
  timeout: Int,
) -> Result(Nil, core.AmqpError)
✨ Search Document