Coder Social home page Coder Social logo

Comments (2)

CrowdHailer avatar CrowdHailer commented on June 6, 2024

This change should definitely happen. I can't think of any good arguments for keeping it as it currently is.

We need to consider the fact that handle_info is part of both the Server and SimpleServer interface. I don't know if something can be part of two behaviours or not, so might be awkward if someone wants to implement handle_request and handle_info and use @impl

The other thing of note, maybe you already spotted this. I don't think we can call the full interface streaming, because using just handle_request and handle_info is how to make a server that streams a response, It's how we work with server sent events.

Finally is this a prerequisite of working out middleware? Ideally I would like to add the middleware experiment before tackling this issue

from raxx.

nietaki avatar nietaki commented on June 6, 2024

I totally missed the fact that handle_info is relevant to the handle_request approach, thanks for pointing that out.

I'll think how to best reconcile handle_info being in both interfaces. My best idea right now is handle_request being the only callback in SimpleServer behaviour, and having use SimpleServer leave handle_info callback of Server unimplemented or implemented but overridable.

This is not a prerequisite for middleware, I just needed to get it out in the open, put it on the roadmap and simplify my mental model in advance ;)

Also, good point on

don't think we can call the full interface streaming

I don't have a naming scheme in mind apart from Server/normal/full and SimpleServer/simplified. Let's iron it out further down the line.

Note to my future self: when the interface split happens (or even before that) it would be good to emphatically document the possible values of Raxx.Request body field for handle_head (only true or false) and handle_request (only a binary or false) callbacks. I was almost sure that's how it worked, but I wasn't absolutely certain.

from raxx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.