<div dir="ltr">Let me make a constructive suggestion. By using the configuration, we could avoid the compile-time dependency on either of those modules, and at the same time we could make amqp_connection more flexible.<br>
<br><span style="font-family: courier new,monospace;">%% Starts a new channel. Flavor is direct or network. flavor_module is set up to be</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">%% one of amqp_direct_driver or amqp_network_driver (or, some other driver - e.g. future amqp_wmq_driver)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">handle_call({Flavor, ChannelNumber, OutOfBand}, From, State) -&gt;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp; {ok, Module} = proplists:get_value(Flavor, State#state.flavor_module),</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp; handle_start({ChannelNumber, OutOfBand},</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fun Module:open_channel/3,</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fun Module:close_channel/1,</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fun Module:do/2,</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fun Module:do/3,</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; State);</span><br>
<br>What do you think?<br><br>Regards,<br>Edwin<br></div>