rabbitmq / rabbitmq-erlang-client

Erlang client for RabbitMQ
https://www.rabbitmq.com/
Other
184 stars 127 forks source link

Why not return the gen_server:start_link/3 directly #44

Closed jamesaimonetti closed 5 years ago

jamesaimonetti commented 8 years ago

Looking at the amqp_rpc_server:start_link/3, why not just return the result of gen_server:start_link/3? If I want to start these under a simple_one_for_one supervisor, supervisor:start_child/2 expects the tuples and not a raw pid().

Just curious what the reasoning is for raw pids as a return instead of the tuples?

michaelklishin commented 8 years ago

I doubt there's a big idea behind this, it was introduced close to 3 years ago in https://github.com/rabbitmq/rabbitmq-erlang-client/commit/1c3a50e7b75ad5d036814fc7a5e0c8517ceb4420.

I think your suggestion makes sense. Keep in mind that the RPC server is mostly an example. We don't assume it's the best (or the only reasonable) implementation out there.

michaelklishin commented 8 years ago

I think we can make this change for 3.7.0. @dumbbell @hairyhum @essen WDYT?

jamesaimonetti commented 8 years ago

@michaelklishin thanks, was just using it while doing a PoC. Works fine in the prototype. Will keep this in mind when we get to more serious implementations. Thanks!