|
|
| Author |
Message |
< RabbitMQ mailing list ~ Suggestion: add start/4 to amqp_connection in Erlang client |
| Guest |
Posted: Tue Jun 17, 2008 11:20 pm |
|
|
|
Guest
|
There's no way to start a connection on a given vhost in the current version of the Erlang client. amqp_connection only has start/2 and start/3 functions.
I propose adding start/4 to amqp_connection by modifying it as follows:
%% Starts a networked conection to a remote AMQP server.start(User, Password, Host) -> |
|
|
| Back to top |
|
| 0x6e6562 |
Posted: Wed Jun 18, 2008 6:12 am |
|
|
|
User
Joined: 12 Jul 2007
Posts: 250
|
Edwin,
On Wed, Jun 18, 2008 at 12:19 AM, Edwin Fine
<rabbitmq-discuss_efine@usa.net> wrote:
> There's no way to start a connection on a given vhost in the current version
> of the Erlang client. amqp_connection only has start/2 and start/3
> functions.
>
> I propose adding start/4 to amqp_connection by modifying it as follows:
>
> %% Starts a networked conection to a remote AMQP server.
> start(User, Password, Host) ->
> start(User, Password, Host, <<"/">>).
>
> start(User, Password, Host, Vhost) when is_binary(Vhost) ->
> Handshake = fun amqp_network_driver:handshake/1,
> InitialState = #connection_state{username = User,
> password = Password,
> serverhost = Host,
> vhostpath = Vhost},
> {ok, Pid} = gen_server:start_link(?MODULE, [InitialState, Handshake],
> []),
> {Pid, network}.
>
> This does work, as I have been using the modified code for some months now.
>
> Any takers?
I've already applied this patch as part of a previous discussion on
the list, so it's in the latest version of the Erlang client. The
Erlang client has been migrated from monotone to hg, we are just
waiting on some infrastructure changes to go through to make the
Erlang client public again. Let me know if you want me to send you a
zipped image of the latest version for the meantime.
HTH,
Ben
_______________________________________________
rabbitmq-discuss mailing list
rabbitmq-discuss@lists.rabbitmq.com
http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
Post received from mailinglist |
|
|
| Back to top |
|
|
|
All times are GMT
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You cannot download files in this forum
|
|
|