From 8de48fea63ea577e7fb83c48ad66aeaed0237805 Mon Sep 17 00:00:00 2001 From: Christopher Davenport Date: Tue, 4 Jan 2022 21:31:49 -0800 Subject: [PATCH] Change Param Names --- .../scala/io/chrisdavenport/rediculous/RedisCommands.scala | 6 +++--- .../scala/io/chrisdavenport/rediculous/RedisStream.scala | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/core/src/main/scala/io/chrisdavenport/rediculous/RedisCommands.scala b/core/src/main/scala/io/chrisdavenport/rediculous/RedisCommands.scala index 6415ab1..f0eedc8 100644 --- a/core/src/main/scala/io/chrisdavenport/rediculous/RedisCommands.scala +++ b/core/src/main/scala/io/chrisdavenport/rediculous/RedisCommands.scala @@ -220,15 +220,15 @@ object RedisCommands { val default = XAddOpts(None, None, None, false, None, None) } - def xadd[F[_]: RedisCtx](stream: String, map: List[(String, String)], xaddOpts: XAddOpts = XAddOpts.default): F[String] = { + def xadd[F[_]: RedisCtx](stream: String, body: List[(String, String)], xaddOpts: XAddOpts = XAddOpts.default): F[String] = { val maxLen = xaddOpts.maxLength.toList.flatMap{ l => List("MAXLEN".some, xaddOpts.trimming.map(_.encode), l.encode.some).flattenOption } val minId = xaddOpts.minId.toList.flatMap{ l => List("MINID".some, xaddOpts.trimming.map(_.encode), l.encode.some).flattenOption } val limit = xaddOpts.limit.toList.flatMap(l=> if (xaddOpts.trimming.contains(Trimming.Approximate)) List("LIMIT", l.encode) else List.empty) val noMkStream = Alternative[List].guard(xaddOpts.noMkStream).as("NOMKSTREAM") val id = List(xaddOpts.id.getOrElse("*")) - val body = map.foldLeft(List.empty[String]){ case (s, (k,v)) => s ::: List(k.encode, v.encode) } + val bodyEnd = body.foldLeft(List.empty[String]){ case (s, (k,v)) => s ::: List(k.encode, v.encode) } - RedisCtx[F].unkeyed(NEL("XADD", stream :: maxLen ::: minId ::: limit ::: noMkStream ::: id ::: body)) + RedisCtx[F].unkeyed(NEL("XADD", stream :: maxLen ::: minId ::: limit ::: noMkStream ::: id ::: bodyEnd)) } final case class XReadOpts( diff --git a/core/src/main/scala/io/chrisdavenport/rediculous/RedisStream.scala b/core/src/main/scala/io/chrisdavenport/rediculous/RedisStream.scala index 377783e..cb2f696 100644 --- a/core/src/main/scala/io/chrisdavenport/rediculous/RedisStream.scala +++ b/core/src/main/scala/io/chrisdavenport/rediculous/RedisStream.scala @@ -11,7 +11,7 @@ trait RedisStream[F[_]] { def append(messages: List[RedisStream.XAddMessage]): F[List[String]] def read( - keys: Set[String], + streams: Set[String], chunkSize: Int, initialOffset: String => StreamOffset = {(s: String) => StreamOffset.All(s)}, block: Duration = Duration.Zero,