vortex.channelpool — LuaVortexChannelPool class: channel pools

API documentation for vortex.ChannelPool object representing a set of channels that are reused across the session.

Module API

class vortex.ChannelPool
next_ready(channelpool[, auto_inc][, user_data])

Allows to get a ready channel from the pool. If auto_inc is set to true, the pool creates a new channel in case there is no ready channel at this time.

Parameters:
  • channelpool (vortex.channelpool) – The channel pool where to get a channel.
  • auto_inc (Boolean (default false if not defined)) – Instruct the channel pool to create a new channel in the case no channel is available.
  • user_data (Object) – Optional reference to a object that is passed to the create channel handler defined at vortex.Connection.channel_pool_new.
Return type:

a reference to vortex.Channel or nil if it fails. nil can be returned if auto_inc is not defined or set to false and no ready channel is available.

release(channelpool, channel)

Allows to release the give channel into the pool, making it available for future next_ready calls.

Parameters:
  • channelpool (vortex.channelpool) – The channel pool where to get a channel.
  • channel (vortex.Channel reference acquired via next_ready() call.) – Channel reference to be released.
check(channelpool)

Allows to check if the provided reference is a vortex.channelpool.

Parameters:channelpool (vortex.channelpool) – The channel pool where to get a channel.
Return type:true if the object represents a vortex.channelpool, otherwise false is returned.
id

(Read only attribute) (Integer) returns the channel pool unique identifier. This identifier is unique in context of the connection.

ctx

(Read only attribute) (vortex.ctx) returns the context where the vortex.ChannelPool was created.

conn

(Read only attribute) (vortex.connection) returns the connection where this channel pool is running.

channel_count

(Read only attribute) (Integer) returns the number of channels that are handled by the channel pool.

channel_available

(Read only attribute) (Integer) returns the number of channels available (that are ready to be returned by calling to next_ready ())