Returns the next "ready to use" channel from the given pool.
This function returns the next "ready to use" channel from the given pool. Because a vortex channel pool may have no channel ready to be used the function could return NULL. But you can also make this function to add a new channel to the pool if no channel is ready by using auto_inc as axl_true.
The channel returned can be used for any operation, even closing the channel. But, before issuing a close operation over a channel which already belongs to a pool, this channel must be detached first from the pool using vortex_channel_pool_deattach.
In general a close operation over channels belonging to a pool is not recommended. In fact, the need to avoid channel closing operations was the main reason to produce the channel pool module because, as we have said, the channel close operation is too expensive.
It's a better approach to let the vortex connection destruction function to close all channels created for a pool.
Another recommendation to keep in mind is the startup problem. Due to the initial requirement to create new channels for the pool on the first connection, it may slow down the startup (because it is required to create several channels). A good approach is to create a pool with one channel and use this function with the auto_inc set always to axl_true.
This will enforce to create new channels only when needed reducing the performance impact of creating an arbitrary number of channels (inside the pool) at the startup.
Once the channel was used, you should use vortex_channel_pool_release_channel to return the channel to the pool, making it usable by other invocation. The concept is to release the channel as soon as possible.