Draft
Conversation
balat
commented
Jul 6, 2025
src/lib/eliom_common.server.ml
Outdated
| (* None = new cookie | ||
| (not sent by the browser) *) | ||
| * one_persistent_cookie_info session_cookie ref) | ||
| Promise.t |
balat
commented
Jul 6, 2025
| cached. *) | ||
|
|
||
| val do_cache : ('a, 'b) t -> 'a -> 'b -> unit | ||
| val do_cache : ('a, 'b) t -> 'a -> 'b Eio.Promise.or_exn -> unit |
balat
commented
Jul 6, 2025
| 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 |
Contributor
There was a problem hiding this comment.
local_find returns a promise because that's what the cache contains.
balat
commented
Jul 6, 2025
| -> (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 |
balat
commented
Jul 6, 2025
| | 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 *) |
balat
commented
Jul 6, 2025
| end | ||
|
|
||
| let pers_ref_store = Ocsipersist.open_store "eliom__persistent_refs" | ||
| let pers_ref_store = lazy (Ocsipersist.open_store "eliom__persistent_refs") |
Contributor
There was a problem hiding this comment.
This was a Lwt.t before. This is an attempt to make sure that effects are caught by Eio_main.
`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`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.