From d01cc81d90ee6428851142b22edbe2a04a5daed0 Mon Sep 17 00:00:00 2001 From: Clombrong Date: Thu, 14 Aug 2025 15:04:51 +0200 Subject: feat(session): add connection_step type (granular connection step) --- lib/session.ml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/session.ml b/lib/session.ml index 94688bc..0abda51 100644 --- a/lib/session.ml +++ b/lib/session.ml @@ -2,10 +2,13 @@ open Lwt.Syntax open Lwt.Infix open Lwt_react +type connection_step = + | Starting_stream of string + type state = | Disconnected | Opening_portal of string - | Connecting of Portal.t + | Connecting of Portal.t * connection_step | Connected of Portal.t * Stream.features (** [create domain config] is a promise containing a signal representing the portal @@ -40,8 +43,8 @@ let create (domain : string) (config : Stream.config) : (state signal * (unit -> (function | Opening_portal domain -> let+ portal = Portal.connect domain - in update (Connecting portal) - | Connecting portal -> connect portal + in update (Connecting (portal, Starting_stream domain)) + | Connecting (portal, _) -> connect portal | _ -> Lwt.return_unit) state >|= S.keep; in state, fun () -> update (Opening_portal domain) -- cgit v1.2.3