Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Almost complete port to Eio #254

Draft
wants to merge 44 commits into
base: master
Choose a base branch
from
Draft

Commits on Apr 2, 2023

  1. Disable openssl for now

    It segfaults under multicore: see savonet/ocaml-ssl#76
    talex5 authored and Willenbrink committed Apr 2, 2023
    Configuration menu
    Copy the full SHA
    6f608d0 View commit details
    Browse the repository at this point in the history
  2. Get rid of stuff that doesn't build

    talex5 authored and Willenbrink committed Apr 2, 2023
    Configuration menu
    Copy the full SHA
    ef7d7be View commit details
    Browse the repository at this point in the history

Commits on Apr 3, 2023

  1. Initial port to Eio

    This is a proof-of-concept port of Dream to Eio. Most of the public API
    in dream.mli has been changed to no longer use promises and the main
    tutorial examples (`[1-9a-l]-*`) have been updated and are working.
    The documentation mostly hasn't been updated.
    
    Internally, it's still using Lwt in many places, using Lwt_eio to
    convert between them.
    
    The main changes are:
    
    - User code doesn't need to use lwt (or lwt_ppx) now for Dream stuff.
      However, the SQL example still uses lwt for the Caqti callback.
    
    - Dream servers must be wrapped in an `Eio_main.run`.
      Unlike Lwt, where you can somewhat get away with running other
      services with `Lwt.async` before `Dream.run` and relying on the
      mainloop picking them up later, everything in Eio must be started
      from inside the loop. Personally, I think this is clearer and less
      magical, making it obvious that Dream can run alongside other Eio
      code, but obviously Dream had previously made the choice to hide
      the `Lwt_main.run` by default.
    
    - `Dream.run` now takes an `env` argument (from `Eio_main.run`),
      granting it access to the environment. At present, it uses this
      just to start `Lwt_eio`, but once fully converted it should also
      use it to listen on the network and read certificates, etc.
    
    Error handling isn't quite right yet. Ideally, we'd create a new Eio
    switch for each new connection, and that would get the errors. However,
    connection creation is currently handled by Lwt. Also, it still tries to
    attach the request ID to the Lwt thread for logging, which likely won't
    work. I should provide a way to add log tags to fibres in Eio.
    
    Note: `example/k-websocket` logs `Async exception: (Failure "cannot write to closed
    writer")`. It does that on `master` with Lwt too.
    Willenbrink committed Apr 3, 2023
    Configuration menu
    Copy the full SHA
    6c4ed2d View commit details
    Browse the repository at this point in the history
  2. Use Eio to accept network connections

    After accepting a connection we convert it to a Lwt_unix.file_descr and
    continue as before.
    
    The `stop` argument has gone, as you can now just cancel the Eio fibre
    instead. Note that this will cancel all running requests too (unlike the
    previous behaviour, where it only stopped accepting new connections).
    Willenbrink committed Apr 3, 2023
    Configuration menu
    Copy the full SHA
    5c276c5 View commit details
    Browse the repository at this point in the history
  3. Remove ssl dependency

    Segfaults due to savonet/ocaml-ssl#76
    talex5 authored and Willenbrink committed Apr 3, 2023
    Configuration menu
    Copy the full SHA
    5a6cac0 View commit details
    Browse the repository at this point in the history
  4. Update to Eio 0.1

    talex5 authored and Willenbrink committed Apr 3, 2023
    Configuration menu
    Copy the full SHA
    703db62 View commit details
    Browse the repository at this point in the history
  5. Update to Eio 0.2

    Just fixes some deprecation warnings.
    Willenbrink committed Apr 3, 2023
    Configuration menu
    Copy the full SHA
    88d0b24 View commit details
    Browse the repository at this point in the history
  6. Use Eio_unix.sleep in examples

    Anton says he prefers not passing the clock as an argument.
    Willenbrink committed Apr 3, 2023
    Configuration menu
    Copy the full SHA
    942dbfc View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    189929e View commit details
    Browse the repository at this point in the history
  8. Remove lwt from pure

    Willenbrink committed Apr 3, 2023
    Configuration menu
    Copy the full SHA
    72896f8 View commit details
    Browse the repository at this point in the history

Commits on Apr 8, 2023

  1. Remove Lwt from server/ as far as possible

    upload.ml uses Lwt_streams, we convert them directly with lwt_eio
    Willenbrink committed Apr 8, 2023
    Configuration menu
    Copy the full SHA
    9a1cada View commit details
    Browse the repository at this point in the history
  2. Remove lwt from graphql/

    Willenbrink committed Apr 8, 2023
    Configuration menu
    Copy the full SHA
    c1021d6 View commit details
    Browse the repository at this point in the history
  3. Remove Lwt from mirage/

    Willenbrink committed Apr 8, 2023
    Configuration menu
    Copy the full SHA
    59af592 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    a46bb20 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    c1e5e91 View commit details
    Browse the repository at this point in the history
  6. Update dream.mli

    Willenbrink committed Apr 8, 2023
    Configuration menu
    Copy the full SHA
    b600bc1 View commit details
    Browse the repository at this point in the history
  7. Fix examples

    Willenbrink committed Apr 8, 2023
    Configuration menu
    Copy the full SHA
    02208cd View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    a9cca15 View commit details
    Browse the repository at this point in the history
  9. Revert "Disable openssl for now"

    This reverts commit 6f608d0.
    Willenbrink committed Apr 8, 2023
    Configuration menu
    Copy the full SHA
    b30594e View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    c44b79c View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    47a4617 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    fc7ed99 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    ceedc70 View commit details
    Browse the repository at this point in the history
  14. Move static files to eio

    Using capabilities shouldn't be a big problem?
    Eio.Path.with_open_dir seems to work quite nicely if needed
    Willenbrink committed Apr 8, 2023
    Configuration menu
    Copy the full SHA
    f9f68d7 View commit details
    Browse the repository at this point in the history

Commits on Apr 9, 2023

  1. Configuration menu
    Copy the full SHA
    64bef1b View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    d923711 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    8bd26a8 View commit details
    Browse the repository at this point in the history
  4. Switch to mirage_crypto_rng_eio

    Random.initialize isn't called any more. I think its unnecessary as any
    crypto calls will fail explicitly (due to performing an effect without a
    handler). I did not remove it as I'm not that familiar with mirage and
    didn't want to silently break crypto
    Willenbrink committed Apr 9, 2023
    Configuration menu
    Copy the full SHA
    531bb37 View commit details
    Browse the repository at this point in the history

Commits on Apr 10, 2023

  1. Configuration menu
    Copy the full SHA
    b528ea4 View commit details
    Browse the repository at this point in the history
  2. Add mock for g-upload

    Willenbrink committed Apr 10, 2023
    Configuration menu
    Copy the full SHA
    1f7f9b9 View commit details
    Browse the repository at this point in the history

Commits on Apr 13, 2023

  1. Mock upload gets stuck

    Willenbrink committed Apr 13, 2023
    Configuration menu
    Copy the full SHA
    334311e View commit details
    Browse the repository at this point in the history
  2. Remove superfluous switch

    Willenbrink committed Apr 13, 2023
    Configuration menu
    Copy the full SHA
    0b53d91 View commit details
    Browse the repository at this point in the history

Commits on Apr 19, 2023

  1. Configuration menu
    Copy the full SHA
    4c3c387 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    b98ab65 View commit details
    Browse the repository at this point in the history
  3. Remove loader from static

    Willenbrink committed Apr 19, 2023
    Configuration menu
    Copy the full SHA
    306a49a View commit details
    Browse the repository at this point in the history
  4. Fix forgotten example

    Willenbrink committed Apr 19, 2023
    Configuration menu
    Copy the full SHA
    83a6137 View commit details
    Browse the repository at this point in the history

Commits on Apr 20, 2023

  1. Revert whitespace changes

    Willenbrink committed Apr 20, 2023
    Configuration menu
    Copy the full SHA
    b625e72 View commit details
    Browse the repository at this point in the history

Commits on Apr 21, 2023

  1. Configuration menu
    Copy the full SHA
    0951517 View commit details
    Browse the repository at this point in the history
  2. Remove unnecessary make default target

    It was picking up Mirage dependencies. The build target has been updated
    in master so as to be useful in a Dune workspace and in this PR, without
    picking up extra dependencies.
    aantron committed Apr 21, 2023
    Configuration menu
    Copy the full SHA
    3bb33d7 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    8757a12 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    df07d35 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    42f54bb View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    ad54366 View commit details
    Browse the repository at this point in the history
  7. Ignore unused vars

    Willenbrink committed Apr 21, 2023
    Configuration menu
    Copy the full SHA
    a9634bc View commit details
    Browse the repository at this point in the history