Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions src/client.ml
Original file line number Diff line number Diff line change
Expand Up @@ -395,9 +395,10 @@ module Make(IO : S.IO) = struct
function
| `Bulk Some next_cursor :: `Multibulk keys :: [] ->
let next_cursor = int_of_string next_cursor in
let keys = List.map (function
| `Bulk (Some s) -> s
| x -> IO.fail (Unexpected x); "") keys in
IO.map_serial (function
| `Bulk (Some s) -> IO.return s
| x -> IO.fail (Unexpected x) >>= fun () -> IO.return "") keys
>>= fun keys ->
IO.return (next_cursor, keys)
| _ -> IO.fail (Error "SCAN returned unexpected result")

Expand Down Expand Up @@ -748,10 +749,10 @@ module Make(IO : S.IO) = struct
function
| `Bulk Some next_cursor :: `Multibulk keys :: [] ->
let next_cursor = int_of_string next_cursor in
let entries =
List.map (function
| `Bulk (Some s) -> s
| x -> IO.fail (Unexpected x); "") keys in
IO.map_serial (function
| `Bulk (Some s) -> IO.return s
| x -> IO.fail (Unexpected x) >>= fun () -> IO.return "") keys
>>= fun entries ->
let pairs = Utils.List.pairs_of_list entries |> Utils.Option.default [] in
IO.return (next_cursor, pairs)
| _ -> IO.fail (Error "HSCAN returned unexpected result")
Expand Down
16 changes: 8 additions & 8 deletions src/redis_lwt.ml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ module IO = struct
type 'a t = 'a Lwt.t

type fd = Lwt_unix.file_descr
type in_channel = Lwt_chan.in_channel
type out_channel = Lwt_chan.out_channel
type in_channel = Lwt_io.input_channel
type out_channel = Lwt_io.output_channel

type 'a stream = 'a Lwt_stream.t
type stream_count = unit
Expand All @@ -28,12 +28,12 @@ module IO = struct
let close = Lwt_unix.close
let sleep = Lwt_unix.sleep

let in_channel_of_descr = Lwt_chan.in_channel_of_descr
let out_channel_of_descr = Lwt_chan.out_channel_of_descr
let input_char = Lwt_chan.input_char
let really_input = Lwt_chan.really_input
let output_string = Lwt_chan.output_string
let flush = Lwt_chan.flush
let in_channel_of_descr fd = Lwt_io.of_fd ~mode:Lwt_io.input fd
let out_channel_of_descr fd = Lwt_io.of_fd ~mode:Lwt_io.output fd
let input_char = Lwt_io.read_char
let really_input = Lwt_io.read_into_exactly
let output_string = Lwt_io.write
let flush = Lwt_io.flush

let iter = Lwt_list.iter_p
let iter_serial = Lwt_list.iter_s
Expand Down