[erlang-questions] RabbitMQ Erlang client integration

Garrett Smith g@REDACTED
Tue Nov 20 18:19:14 CET 2012


I'd be tempted to isolate the conflicting code into one or more
separate modules, which hide the use of the record and provide a more
reusable interface.

It's hard to know without seeing the code, but that course might be
much easier than dealing with tuples.

Garrett


On Tue, Nov 20, 2012 at 7:47 AM, Martin Dimitrov <mrtndimitrov@REDACTED> wrote:
> That is actually my problem - in a module I have to include both .hrl files
>
> On 11/20/2012 1:13 PM, Patrik Nyblom wrote:
>> Hi!
>>
>> Record names are just names in headers, nothing stops you from having
>> one record named e.g. user in one module and a completely different
>> record with the same name in another. As long as you do not include both
>> headers (or in some other way manage to declare the record "type" twice)
>> in the same source code, you're OK. So just limit the use of the
>> rabbitmq user record to a module that does not use your own user record.
>>
>> /Patrik
>> On 11/20/2012 11:06 AM, Martin Dimitrov wrote:
>>> Thanks. I was hoping for a more elegant solution but this will do.
>>>
>>> On 11/20/2012 11:47 AM, Dmitry Demeshchuk wrote:
>>>> The possibly shortest way is to abuse the fact that records are actually
>>>> tuples and instead of using a #user record for rabbitmq just use a tuple
>>>> that corresponds to it. And comment out the rabbitmq's #user record
>>>> definition, of course.
>>>>
>>>>
>>>> On Tue, Nov 20, 2012 at 1:44 PM, Martin Dimitrov
>>>> <mrtndimitrov@REDACTED>wrote:
>>>>
>>>>> Hi all,
>>>>>
>>>>> I want to connect to RabbitMQ broker through the Erlang client
>>>>> listed on
>>>>> their site. The problem is that it defines a record "user" and in our
>>>>> app we already have such named record.
>>>>>
>>>>> What can I do with minimal code changes?
>>>>>
>>>>> Thank you very much.
>>>>>
>>>>> Regards,
>>>>> Martin
>>>>> _______________________________________________
>>>>> erlang-questions mailing list
>>>>> erlang-questions@REDACTED
>>>>> http://erlang.org/mailman/listinfo/erlang-questions
>>>>>
>>>>
>>>>
>>> _______________________________________________
>>> erlang-questions mailing list
>>> erlang-questions@REDACTED
>>> http://erlang.org/mailman/listinfo/erlang-questions
>>
>> _______________________________________________
>> erlang-questions mailing list
>> erlang-questions@REDACTED
>> http://erlang.org/mailman/listinfo/erlang-questions
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions



More information about the erlang-questions mailing list