From f3ca71b50988d9354a3e6dc1d795645537293a87 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Sat, 13 May 2023 13:06:15 +0200 Subject: [PATCH] add a start and stop fn --- bin/main.ml | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/bin/main.ml b/bin/main.ml index a973412..0bea756 100644 --- a/bin/main.ml +++ b/bin/main.ml @@ -1,15 +1,23 @@ open Pusk.Net open Pusk.Drivers -let main = - let session_id = get_session in - let body = close_session session_id in - print_endline body +let start driver = + let name_driver = prepare driver in + let data_driver = run_process name_driver [] in + let session_id = get_session () in + data_driver, session_id ;; -let () = - let driver = prepare (Gecko "0.33.0") in - let driver_process = run_process driver [] in - main; +let stop (driver_process, session_id) = + let data = close_session session_id in + print_endline data; stop_process driver_process ;; + +let main () = () + +let () = + let data = start (Gecko "0.33.0") in + main (); + stop data +;;