Skip to content

Conversation

balat
Copy link
Member

@balat balat commented Jul 6, 2025

No description provided.

(* None = new cookie
(not sent by the browser) *)
* one_persistent_cookie_info session_cookie ref)
Promise.t
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?

cached. *)

val do_cache : ('a, 'b) t -> 'a -> 'b -> unit
val do_cache : ('a, 'b) t -> 'a -> 'b Eio.Promise.or_exn -> unit
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

request) and the client side cache. *)

val local_find : ('a, 'b) t -> 'a -> 'b
val local_find : ('a, 'b) t -> 'a -> 'b Eio.Promise.or_exn
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

local_find returns a promise because that's what the cache contains.

-> (string * string) list Promise.t option
-> (string * Eliom_lib.file_info) list Promise.t option
-> (string * string) list option
-> (string * Eliom_lib.file_info) list option
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

| Ocsiper of 'a option Ocsipersist.t Promise.t (* Global persist. table *)
| Ocsiper_sit of 'a Ocsipersist.table Promise.t (* Persist. table for site *)
| Per of 'a persistent_table Promise.t
| Ocsiper of 'a option Ocsipersist.t Lazy.t (* Global persist. table *)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

end

let pers_ref_store = Ocsipersist.open_store "eliom__persistent_refs"
let pers_ref_store = lazy (Ocsipersist.open_store "eliom__persistent_refs")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was a Lwt.t before. This is an attempt to make sure that effects are caught by Eio_main.

Julow added 6 commits July 15, 2025 16:11
`Lwt_stream` is difficult to migrate to other concurrency libraries
because of its vast API and its many usecases.

Its usage in `Eliom_comet` can easily be changed to a callback-based
approach. This might increase performances as well.
Add a new callback-based API, `Eliom_bus.register`, which avoids using
`Lwt_stream` internally.

`Eliom_bus.stream` is re-implemented against the register API.
`Eliom_bus.original_stream` is not re-implemented yet.
`Eliom_comet.register` and `Eliom_bus.register` propagate errors from
the server using an `option` type.
`Eliom_bus` ensures that the callback won't be called again after being
called with `None`.

This "end of stream or error" signal was present before through
`Lwt_stream`, which could propagate the `Closed` exception.

In both `Eliom_comet` and `Eliom_bus`, the callbacks are released when
the channel closes to allow memory to be collected.
Implement the callback-based API that can be used with values of type
[Eliom_comet.Channel.t] that can be passed from the server.
- Remove `Eliom_bus.stream` and `Eliom_bus.original_stream`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants