Skip to content

Commit

Permalink
refactor: rewrite conn type for RedisClient (#187)
Browse files Browse the repository at this point in the history
  • Loading branch information
iuioiua authored Dec 19, 2024
1 parent 68da44c commit 001a888
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ export async function readReply(
}

async function sendCommand(
redisConn: Deno.Conn,
redisConn: Reader & Writer,
command: Command,
raw = false,
): Promise<Reply> {
Expand All @@ -237,7 +237,7 @@ async function sendCommand(
}

async function pipelineCommands(
redisConn: Deno.Conn,
redisConn: Reader & Writer,
commands: Command[],
): Promise<Reply[]> {
const bytes = commands.map(createRequest);
Expand All @@ -246,7 +246,7 @@ async function pipelineCommands(
}

async function* readReplies(
redisConn: Deno.Conn,
redisConn: Reader & Writer,
raw = false,
): AsyncIterableIterator<Reply> {
const iterator = readLines(redisConn);
Expand All @@ -256,11 +256,11 @@ async function* readReplies(
}

export class RedisClient {
#conn: Deno.TcpConn | Deno.TlsConn;
#conn: Reader & Writer;
#queue: Promise<any> = Promise.resolve();

/** Constructs a new instance. */
constructor(conn: Deno.TcpConn | Deno.TlsConn) {
constructor(conn: Reader & Writer) {
this.#conn = conn;
}

Expand Down

0 comments on commit 001a888

Please sign in to comment.