package amqp-client-async
Install
Dune Dependency
Authors
Maintainers
Sources
md5=9db83accd0dfa9231c3f2ca0de9c8d9f
sha512=921c3f4d0d655dc5caa5c89fe8c4309a6e22d91167676062e0e73f3007b0b5de20e7b461aefdddca6dbdf716d57d90eaefb7e974ae218cce0f0a20fb461c965d
doc/amqp-client-async/Amqp_client_async/Queue/index.html
Module Amqp_client_async.Queue
Source
Operations on Queues
val declare :
_ Channel.t ->
?durable:bool ->
?exclusive:bool ->
?auto_delete:bool ->
?passive:bool ->
?arguments:Amqp_client_lib.Types.table ->
?autogenerate:bool ->
string ->
t Thread.Deferred.t
Declare a queue.
To use server-generated queue name explicitly pass ~autogenerate:true
and empty name: declare channel ~autogenerate:true ""
. Reason for making autogenerate
param explicit is inability in production to find out which services are leaking queues with auto-generated names. We advice not to use this feature in production.
Get a single message from the queue. The function automatically handles ack.
If no_ack
is false (default), the message is requsted with expicit ack and the caller is responsible for ack'ing or rejecting the message.
Publish a message directly to a queue
val consume :
id:string ->
?no_local:bool ->
?no_ack:bool ->
?exclusive:bool ->
?on_cancel:(unit -> unit) ->
'a Channel.t ->
t ->
('a consumer * Message.t Thread.Pipe.Reader.t) Thread.Deferred.t
Setup consumption of a queue. Remember to ack messages.
All messages are processed concurrently. To limit number of concurrent processes, set the prefetch threshold.
on_cancel
is called if the server cancels consumption. This may happen if e.g. the queue is deleted. If the argument is not provided and exception is raised.
Cancel consumption.
Bind a queue to an exchange. Messages posted on the exchange which match the routing key (and optionally match the headers) will be routed to the queue
Remove a binding from an exchange to a queue
Purge all messages on a queue
Delete a queue