@@ -123,37 +123,6 @@ trait Lists[G[+_]] extends RedisEnvironment[G] {
123123 }
124124 }
125125
126- /**
127- * Pops an element from the list stored at source, pushes it to the list stored at destination; or block until one is
128- * available. This is the blocking variant of [[zio.redis.api.Lists#rPopLPush ]].
129- *
130- * @param source
131- * the key identifier of the source list
132- * @param destination
133- * the key identifier of the target list
134- * @param timeout
135- * the maximum time to wait for an element to be available. A timeout of zero can be used to block indefinitely
136- * @return
137- * the element being popped from source and pushed to destination. If timeout is reached, an empty reply is
138- * returned.
139- */
140- final def brPopLPush [S : Schema , D : Schema ](
141- source : S ,
142- destination : D ,
143- timeout : Duration
144- ): ResultBuilder1 [Option , G ] =
145- new ResultBuilder1 [Option , G ] {
146- def returning [V : Schema ]: G [Option [V ]] = {
147- val command = RedisCommand (
148- BrPopLPush ,
149- Tuple3 (ArbitraryValueInput [S ](), ArbitraryValueInput [D ](), DurationSecondsInput ),
150- OptionalOutput (ArbitraryOutput [V ]())
151- )
152-
153- command.run((source, destination, timeout))
154- }
155- }
156-
157126 /**
158127 * Returns the element at index in the list stored at key.
159128 *
@@ -463,28 +432,6 @@ trait Lists[G[+_]] extends RedisEnvironment[G] {
463432 RedisCommand (RPop , ArbitraryKeyInput [K ](), OptionalOutput (ArbitraryOutput [V ]())).run(key)
464433 }
465434
466- /**
467- * Atomically removes the last element in the list stored at source, prepends it to the list stored at destination and
468- * returns it. If source and destination are the same, the operation is equivalent to removing the last element from
469- * the list and pushing it as first element of the same list, so it can be considered as a list rotation command.
470- *
471- * @param source
472- * the key identifier of the source list
473- * @param destination
474- * the key identifier of the destination list
475- * @return
476- * the element being popped and pushed. If source does not exist, empty is returned and no operation is performed.
477- */
478- final def rPopLPush [S : Schema , D : Schema ](source : S , destination : D ): ResultBuilder1 [Option , G ] =
479- new ResultBuilder1 [Option , G ] {
480- def returning [V : Schema ]: G [Option [V ]] =
481- RedisCommand (
482- RPopLPush ,
483- Tuple2 (ArbitraryValueInput [S ](), ArbitraryValueInput [D ]()),
484- OptionalOutput (ArbitraryOutput [V ]())
485- ).run((source, destination))
486- }
487-
488435 /**
489436 * Appends one or more elements to the list stored at key. If key does not exist, it is created as empty list before
490437 * performing the push operation.
@@ -525,24 +472,22 @@ trait Lists[G[+_]] extends RedisEnvironment[G] {
525472}
526473
527474private [redis] object Lists {
528- final val BlMove = " BLMOVE"
529- final val BlPop = " BLPOP"
530- final val BrPop = " BRPOP"
531- final val BrPopLPush = " BRPOPLPUSH"
532- final val LIndex = " LINDEX"
533- final val LInsert = " LINSERT"
534- final val LLen = " LLEN"
535- final val LMove = " LMOVE"
536- final val LPop = " LPOP"
537- final val LPos = " LPOS"
538- final val LPush = " LPUSH"
539- final val LPushX = " LPUSHX"
540- final val LRange = " LRANGE"
541- final val LRem = " LREM"
542- final val LSet = " LSET"
543- final val LTrim = " LTRIM"
544- final val RPop = " RPOP"
545- final val RPopLPush = " RPOPLPUSH"
546- final val RPush = " RPUSH"
547- final val RPushX = " RPUSHX"
475+ final val BlMove = " BLMOVE"
476+ final val BlPop = " BLPOP"
477+ final val BrPop = " BRPOP"
478+ final val LIndex = " LINDEX"
479+ final val LInsert = " LINSERT"
480+ final val LLen = " LLEN"
481+ final val LMove = " LMOVE"
482+ final val LPop = " LPOP"
483+ final val LPos = " LPOS"
484+ final val LPush = " LPUSH"
485+ final val LPushX = " LPUSHX"
486+ final val LRange = " LRANGE"
487+ final val LRem = " LREM"
488+ final val LSet = " LSET"
489+ final val LTrim = " LTRIM"
490+ final val RPop = " RPOP"
491+ final val RPush = " RPUSH"
492+ final val RPushX = " RPUSHX"
548493}
0 commit comments