module Netamqp_queue:Managing queuessig
..end
typequeue_name =
string
type'a
declare_result =out:(queue_name:queue_name ->
message_count:Rtypes.uint4 -> consumer_count:Rtypes.uint4 -> 'a) ->
unit -> 'a
declare
is returned by providing this function to the caller.
When this function is called with an out
argument, it will immediately
call out
back with the result values. The return value of cb
is
the return value of declare_result
.
Arguments of out
:
queue_name
: the queue namemessage_count
: Number of messages in the queue consumer_count
: Number of active consumersval declare_passively_e : channel:Netamqp_channel.channel_obj ->
queue:queue_name ->
?no_wait:bool -> unit -> 'a declare_result Uq_engines.engine
val declare_passively_s : channel:Netamqp_channel.channel_obj ->
queue:queue_name ->
?no_wait:bool -> unit -> 'a declare_result
queue_name
exists, and raise
a channel error if not.
no_wait
: see below let r = declare_passively_s ~channel ~queue ()
let qn = r ~out:(fun ~queue_name ~message_count ~consumer_count ->
queue_name) ()
(* qn is now the returned queue name *)
val declare_e : channel:Netamqp_channel.channel_obj ->
queue:queue_name ->
?durable:bool ->
?exclusive:bool ->
?auto_delete:bool ->
?no_wait:bool ->
?arguments:Netamqp_rtypes.table ->
unit -> 'a declare_result Uq_engines.engine
val declare_s : channel:Netamqp_channel.channel_obj ->
queue:queue_name ->
?durable:bool ->
?exclusive:bool ->
?auto_delete:bool ->
?no_wait:bool ->
?arguments:Netamqp_rtypes.table -> unit -> 'a declare_result
Arguments:
queue
: The queue namedurable
: whether to keep the queue across server restartsexclusive
: whether to consider the queue as private for this
connection, and to delete it automatically when the connection is closed.auto_delete
: whether to delete the queue when all consumers have
finished using itno_wait
: whether not to wait for the response of the declaration.
This is faster, but errors are not immediately reported.arguments
: Arguments. let r = declare_s ~channel ~queue ()
let qn = r ~out:(fun ~queue_name ~message_count ~consumer_count ->
queue_name) ()
(* qn is now the returned queue name *)
val bind_e : channel:Netamqp_channel.channel_obj ->
queue:queue_name ->
exchange:Netamqp_exchange.exchange_name ->
routing_key:string ->
?no_wait:bool ->
?arguments:Netamqp_rtypes.table -> unit -> unit Uq_engines.engine
val bind_s : channel:Netamqp_channel.channel_obj ->
queue:queue_name ->
exchange:Netamqp_exchange.exchange_name ->
routing_key:string ->
?no_wait:bool -> ?arguments:Netamqp_rtypes.table -> unit -> unit
Arguments:
queue
: The queue to bindexchange
: The exchange the queue is bound torouting_key
: The routing keys used by the exchange as criterion
whether messages are appended to the queue.no_wait
: whether not to wait for the response of the request.
This is faster, but errors are not immediately reported.arguments
: Arguments. At least the "headers" exchange type needs
arguments.val unbind_e : channel:Netamqp_channel.channel_obj ->
queue:queue_name ->
exchange:Netamqp_exchange.exchange_name ->
routing_key:string ->
?arguments:Netamqp_rtypes.table -> unit -> unit Uq_engines.engine
val unbind_s : channel:Netamqp_channel.channel_obj ->
queue:queue_name ->
exchange:Netamqp_exchange.exchange_name ->
routing_key:string -> ?arguments:Netamqp_rtypes.table -> unit -> unit
queue
, exchange
, routing_key
and arguments
identify the binding to delete.val purge_e : channel:Netamqp_channel.channel_obj ->
queue:queue_name ->
?no_wait:bool -> unit -> Rtypes.uint4 Uq_engines.engine
val purge_s : channel:Netamqp_channel.channel_obj ->
queue:queue_name -> ?no_wait:bool -> unit -> Rtypes.uint4
Arguments:
queue
: the name of the queueno_wait
: whether not to wait for the response of the request.
This is faster, but errors are not immediately reported.val delete_e : channel:Netamqp_channel.channel_obj ->
queue:queue_name ->
?if_unused:bool ->
?if_empty:bool -> ?no_wait:bool -> unit -> Rtypes.uint4 Uq_engines.engine
val delete_s : channel:Netamqp_channel.channel_obj ->
queue:queue_name ->
?if_unused:bool -> ?if_empty:bool -> ?no_wait:bool -> unit -> Rtypes.uint4
Arguments:
queue
: The queue to deleteif_unused
: Only delete if there are no consumersif_empty
: Only delete if the queue is emptyno_wait
: whether not to wait for the response of the request.
This is faster, but errors are not immediately reported.