package amqp-client-lwt

  1. Overview
  2. Docs

Module Amqp_client_lwt.ChannelSource

Operations on channels

Sourcetype _ t
Sourcetype 'a confirms
Sourcetype no_confirm = [
  1. | `Ok
]
Sourcetype with_confirm = [
  1. | `Ok
  2. | `Failed
]
Sourceval no_confirm : no_confirm confirms
Sourceval with_confirm : with_confirm confirms
Sourceval create : id:string -> 'a confirms -> Framing.t -> Framing.channel_no -> 'a t Thread.Deferred.t

Create a new channel. Use Connection.open_channel rather than this method directly

Sourceval close : _ t -> unit Thread.Deferred.t

Close the channel

Sourceval on_closed : _ t -> unit Thread.Deferred.t

on_closed becomes determined after then channel is closed.

If there are no consumers of this when the channel is close Connection_closed will be raised to the governing exception handler (the parent monitor in async, or Lwt.async_exception_hook in lwt).

Receive all returned messages. Reutnred message will be send to all readers returned from call to this function. Listening for returned messages are useful in e.g. rpc to know that message delivery failed and then stop waiting for a response.

Note that channels in ack mode there is no need to listen for returned messages, as message delivery will fail synchoniously.

Sourceval id : _ t -> string

Get the id of the channel

Sourceval channel_no : _ t -> int

Get the channel_no of the connection

Sourceval set_prefetch : ?count:int -> ?size:int -> _ t -> unit Thread.Deferred.t

Set prefetch counters for a channel.

  • parameter count

    Maximum messages inflight (un-acked)

  • parameter size

    Maximum amount of bytes inflight

Note. if using rabbitmq, the prefetch limits are set per consumer on the channel, rather than per channel (across consumers)

Sourceval set_global_prefetch : ?count:int -> ?size:int -> _ t -> unit Thread.Deferred.t

Set global prefetch counters.

  • parameter count

    Maximum messages inflight (un-acked)

  • parameter size

    Maximum amount of bytes inflight

Note: if using rabbitmq, the prefetch limits are set per channel (across consumers), If not, the global prefetch settings is applied globally - across consumers and channels.

Sourceval flush : _ t -> unit Thread.Deferred.t

Flush the channel, making sure all messages have been sent

Sourcemodule Transaction : sig ... end

Transactions. Transactions can be made per channel.

OCaml

Innovation. Community. Security.