Update https-unikernel to released capnp-rpc 0.1 API

Also, separate out RPC encoding from application logic.

Signed-off-by: Thomas Leonard <thomas.leonard@docker.com>
This commit is contained in:
Thomas Leonard
2017-08-15 12:08:36 +01:00
parent 236cfad571
commit 86b4f01e17
17 changed files with 290 additions and 265 deletions

View File

@@ -1,19 +1,20 @@
(** Run the Store service as a stand-alone Unix process. *)
open Lwt.Infix
let () = Common.init_logging ()
let () = Logging.init ()
let main store_socket =
Lwt_main.run begin
Lwt_switch.with_switch @@ fun switch ->
Store.service () >>= fun store ->
Common.listen ~switch ~offer:store store_socket
Store.local () >>= fun store ->
Capnp_rpc_unix.serve ~offer:store store_socket
end
open Cmdliner
let store =
let doc = "The database store to serve" in
Arg.(required @@ pos 0 (some string) None @@ info ~doc ~docv:"STORE" [])
Arg.(required @@ pos 0 (some Capnp_rpc_unix.Listen_address.conv) None @@ info ~doc ~docv:"STORE" [])
let cmd =
Term.(const main $ store), Term.info "store"