Shell: update to lwt.2.7.0

This commit is contained in:
Grégoire Henry 2017-01-14 13:12:55 +01:00
parent 7689021810
commit df81d95614
4 changed files with 20 additions and 16 deletions

View File

@ -198,7 +198,7 @@ end = struct
let lock = Lwt_mutex.create () let lock = Lwt_mutex.create ()
let get_block cctxt level = let get_block _cctxt level =
Lwt_mutex.with_lock lock Lwt_mutex.with_lock lock
(fun () -> (fun () ->
load () >>=? fun map -> load () >>=? fun map ->

View File

@ -93,12 +93,15 @@ let filter_valid_endorsement cctxt { hash; content } =
let monitor_endorsement cctxt = let monitor_endorsement cctxt =
monitor cctxt ~contents:true ~check:true () >>= fun ops_stream -> monitor cctxt ~contents:true ~check:true () >>= fun ops_stream ->
let endorsement_stream, push = Lwt_stream.create () in let endorsement_stream, push = Lwt_stream.create () in
Lwt_stream.on_termination ops_stream (fun () -> push None) ; Lwt.async begin fun () ->
Lwt.async (fun () -> Lwt_stream.closed ops_stream >|= fun () -> push None
Lwt_stream.iter_p end;
(Lwt_list.iter_p (fun e -> Lwt.async begin fun () ->
filter_valid_endorsement cctxt e >>= function Lwt_stream.iter_p
| None -> Lwt.return_unit (Lwt_list.iter_p (fun e ->
| Some e -> push (Some e) ; Lwt.return_unit)) filter_valid_endorsement cctxt e >>= function
ops_stream) ; | None -> Lwt.return_unit
| Some e -> push (Some e) ; Lwt.return_unit))
ops_stream
end ;
Lwt.return endorsement_stream Lwt.return endorsement_stream

View File

@ -15,7 +15,7 @@ let cctxt = Client_commands.ignore_context
let root = let root =
let root = let root =
RPC.register RPC.empty Services.contracts @@ fun block () -> RPC.register RPC.empty Services.contracts @@ fun _block () ->
Client_proto_contracts.RawContractAlias.load cctxt >>= fun list -> Client_proto_contracts.RawContractAlias.load cctxt >>= fun list ->
let (names, _) = List.split list in let (names, _) = List.split list in
RPC.Answer.return names in RPC.Answer.return names in

View File

@ -18,21 +18,22 @@ depends: [
"calendar" "calendar"
"cohttp" {>= "0.21" } "cohttp" {>= "0.21" }
"config-file" "config-file"
"conduit" {= "0.14.0" } # Version 0.14.1 doas not compile with `ssl` (17/01/02) "conduit"
"git" "git"
"git-unix" "git-unix"
"irmin-watcher" (* for `irmin.unix` *) "irmin-watcher" (* for `irmin.unix` *)
"irmin" {>= "0.12"} "irmin" {>= "0.12" }
"lwt" {>= "2.7.0" }
"lwt_ssl"
"menhir" "menhir"
"ocp-ocamlres" {>= "dev"} "ocp-ocamlres" {>= "dev" }
"ocplib-endian" "ocplib-endian"
"ocplib-json-typed" "ocplib-json-typed"
"ocplib-resto" {>= "dev"} "ocplib-resto" {>= "dev" }
"reactiveData" "reactiveData"
"tyxml" "tyxml"
"js_of_ocaml" "js_of_ocaml"
"sodium" {>= "0.3.0"} "sodium" {>= "0.3.0" }
"ssl"
"kaputt" # { test } "kaputt" # { test }
"bisect_ppx" # { test } "bisect_ppx" # { test }
] ]