package amqp-client-lwt
Module Amqp_client_lwt.ConnectionSource
Connection
val connect :
id:string ->
?virtual_host:string ->
?port:int ->
?credentials:(string * string) ->
?heartbeat:int ->
string ->
t Thread.Deferred.tConnect to an Amqp server.
connect ~id:"test" localhost connects to localhost using default guest credentials, with identity "test"
If an error occurs an exception is raised. To capture and handle exceptions it is advised to detach a monitor Core.Async.Monitor and handle raised exceptions.
The most important exception is Connection_closed. As the connection is stateful (channels are tied to connections e.g), the connection cannot be re-established without redoing all initalization.
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.
Open a new channel.
on_closed becomes ready when the connection has been closed.