DotNetWorkQueue.Transport.Redis.Basic.RedisQueueRpcConnection.GetConnection C# (CSharp) Method

GetConnection() public method

Gets the connection.
public GetConnection ( ConnectionTypes connectionType ) : IConnectionInformation
connectionType ConnectionTypes Type of the connection.
return IConnectionInformation
        public override IConnectionInformation GetConnection(ConnectionTypes connectionType)
        {
            switch (connectionType)
            {
                case ConnectionTypes.NotSpecified:
                case ConnectionTypes.Send:
                    return new BaseConnectionInformation(_queue, _connection);
                case ConnectionTypes.Receive:
                    return new BaseConnectionInformation(string.Concat(_queue, "Response"), _connection);
                default:
                    throw new DotNetWorkQueueException($"unhandled type {connectionType}");
            }
        }
    }

Usage Example

 public void Create_Default(string connection, string queue)
 {
     var test = new RedisQueueRpcConnection(connection, queue);
     test.GetConnection(ConnectionTypes.NotSpecified);
     test.GetConnection(ConnectionTypes.Receive);
     test.GetConnection(ConnectionTypes.Send);
 }