Amqp_client_async.Connection
val connect :
id:string ->
?virtual_host:string ->
?port:int ->
?credentials:(string * string) ->
?heartbeat:int ->
string ->
t Thread.Deferred.t
Connect to an Amqp server.
connect ~id:"test" localhost
connects to localhost using default guest credentials, with identity "test"
val connect_uri : id:string -> string -> t Thread.Deferred.t
Connect to amqp using an uri.
connect_uri ~id:"test" "amqp://localhost/"
connects to amqp server on localhost using default port and default username/password.
The uri must be on the form: ampq://user:password@hostname:port/vhost?params
. Currently only 'heartbeat_interval=<sec>' parameter is used.
val open_channel :
id:string ->
'a Channel.confirms ->
t ->
'a Channel.t Thread.Deferred.t
Open a new channel.
val close : t -> unit Thread.Deferred.t
val on_closed : t -> unit Thread.Deferred.t
on_closed
becomes ready when the connection has been closed.