Skip to content

Add ReqBody and some notion of delayed IO #1

Open

Description

@owickstrom

As in Servant, we need some delayed IO for work that shouldn't be done until a certain route has been selected. We do not want to read the request body, just because we traverse a ReqBody in the routing type, if the embedded handler does not match the request (and possibly cause 4xx errors and whatnot!). Instead, these things should build up and only be run when necessary.

Activity

  1. owickstrom commented on Mar 27, 2017

    @owickstrom
    CollaboratorAuthor

    I've started experimenting with this. Early stuff. :)

  2. yanok commented on Oct 18, 2017

    @yanok

    Hi! Thanks for this awesome (family of) project! Any news about the ReqBody feature?

  3. owickstrom commented on Oct 20, 2017

    @owickstrom
    CollaboratorAuthor

    @yanok Glad you like them. :) No, sorry, I've had no time to work on it. I did try at some point but it's a rather big and complex change. I doubt I'll have any time soon, so if you or someone else would like to pick this up that'd be great!

  4. yanok commented on Oct 24, 2017

    @yanok

    @owickstrom I'm a bit busy right now, but I hope to return to it at some point in the (hopefully near) future. But first I'd like to discuss the desired API a bit (sorry, I might ask really stupid questions, I was ignoring the whole Web thing completely until recently).

    1. Does it make sense to be able to put ReqBody in different places in the path? If not, shouldn't we move ReqBody closer to the method selection?
    2. Does it make sense to have multiple ReqBodys?
  5. maxhallinan commented on Sep 11, 2019

    @maxhallinan

    At the moment, I'm using Raw when I need to read the request body. So those parts of the API contract are not represented in the type. It sounds like this feature would give handlers access to the request body without falling back to raw middleware? I'm not an advanced user of PureScript's type system but maybe I could help move this feature forward. Do you have a branch with your earlier work or could you say more about the approach you had in mind?

  6. nsaunders commented on Sep 11, 2019

    @nsaunders
    Contributor

    @maxhallinan see my referenced PR for my first pass at the issue. I assume @owickstrom had something much more sophisticated in mind...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions