Module Netamqp_queue

module Netamqp_queue: sig .. end
Managing queues

type queue_name = string 
Queues are identified by name
type 'a declare_result = out:(queue_name:queue_name ->
message_count:Netnumber.uint4 -> consumer_count:Netnumber.uint4 -> 'a) ->
unit -> 'a
The result of 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:


val 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
Check whether a queue with the given queue_name exists, and raise a channel error if not.

Example how to call this function:
        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
Declare a new queue: Create it if the queue does not exist yet, or else check whether the queue exists with the given properties. A channel error is raised if these conditions are not met.

Arguments:

Example how to call this function:
        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
Bind a queue to an exchange, and set the routing key.

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
Remove a binding. The arguments 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 -> Netnumber.uint4 Uq_engines.engine
val purge_s : channel:Netamqp_channel.channel_obj ->
queue:queue_name -> ?no_wait:bool -> unit -> Netnumber.uint4
This function removes all messages from a queue which are not awaiting acknowledgment.

Arguments:

Result: The function returns the number of purged messages.
val delete_e : channel:Netamqp_channel.channel_obj ->
queue:queue_name ->
?if_unused:bool ->
?if_empty:bool -> ?no_wait:bool -> unit -> Netnumber.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 -> Netnumber.uint4
This function deletes the queue.

Arguments:

Result: The function returns the number of deleted messages.