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

Make server response type abstract and allow streaming in cohttp-eio #1024

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Commits on Feb 28, 2024

  1. Make server response type abstract

    This will allow cohttp-eio to use a different type in future, which
    should make streaming easier.
    talex5 committed Feb 28, 2024
    Configuration menu
    Copy the full SHA
    6860464 View commit details
    Browse the repository at this point in the history
  2. cohttp-eio: Refactor code a bit

    Makes next commit easier to read:
    
    - Use `respond` helpers in example. Avoids it having to change.
    - Remove useless `IO.t` and `>>=`.
    - Move some functions later in the file, and they'll need to use
      `write`.
    talex5 committed Feb 28, 2024
    Configuration menu
    Copy the full SHA
    e48cbaf View commit details
    Browse the repository at this point in the history

Commits on Mar 14, 2024

  1. cohttp-eio: Allow streaming responses from handler

    This changes the response type to `writer -> unit`. This allows
    handlers to write the response inside the function, rather than
    returning a request to cohttp to write it later. That's useful because
    it allows e.g. streaming from an open file and then closing it
    afterwards.
    
    Partial application means that code using `respond_string` etc will
    continue to work as before.
    
    This also exposes a more polymorphic version of the `respond` function
    that accepts sub-types of `Flow.source`, so that callers don't need to
    cast the body.
    talex5 committed Mar 14, 2024
    Configuration menu
    Copy the full SHA
    34f881c View commit details
    Browse the repository at this point in the history

Commits on Mar 18, 2024

  1. Update CHANGES.md

    Co-authored-by: Marcello Seri <mseri@users.noreply.github.com>
    talex5 and mseri committed Mar 18, 2024
    Configuration menu
    Copy the full SHA
    fa9123e View commit details
    Browse the repository at this point in the history

Commits on May 17, 2024

  1. Configuration menu
    Copy the full SHA
    eb92357 View commit details
    Browse the repository at this point in the history