tmcgilchrist / ocaml-gitlab

Native OCaml bindings to Gitlab REST API v4
https://tmcgilchrist.github.io/ocaml-gitlab/gitlab/
BSD 3-Clause "New" or "Revised" License
27 stars 8 forks source link

Some fixes to events #89

Closed arvidj closed 1 year ago

tmcgilchrist commented 1 year ago

Small change to cli/user.ml required to consume the new event stream:

-      User.events ~token:config.token ~id () >|~ fun events ->
-      printf "%s\n" (Yojson.Basic.prettify @@ Gitlab_j.string_of_events events)
+
+      let* events =
+        return @@ User.events ~token:config.token ~id ()
+      in
+      Stream.iter
+        (fun event ->
+          return @@ printf "%s\n" (Yojson.Basic.prettify @@ Gitlab_j.string_of_event event))
+        events
arvidj commented 1 year ago

Small change to cli/user.ml required to consume the new event stream:

Oups, missed that. Fixed in the latest version. I had also forgotten to run ocaml-format.