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

[Proposal] Const Requests #48

Closed
JackThomson2 opened this issue Jul 15, 2021 · 10 comments · Fixed by #210
Closed

[Proposal] Const Requests #48

JackThomson2 opened this issue Jul 15, 2021 · 10 comments · Fixed by #210

Comments

@JackThomson2
Copy link
Contributor

I wonder if we should off an option for a constant response which won't change, this would allow us to never touch python for ultra fast path solutions.

@sansyrox
Copy link
Member

Hey @JackThomson2 , I don't understand what you mean by this. Constant response as in?

@JackThomson2
Copy link
Contributor Author

JackThomson2 commented Jul 15, 2021

For example our hello world request is constant as it always response "HELLO WORLD", so in this case, we could save this rust side, meaning we'd only have to call the python function the first time

@sansyrox
Copy link
Member

@JackThomson2 , but hello world is just an example in our scenario. We definitely require variable response for a web server to exist. Maybe I am unable to understand something but I can't see how a fixed function can be helpful. Won't we still require some sort of python to pass the info?

@JackThomson2
Copy link
Contributor Author

It would be a per function opt-in thing, definitely not for every function.

@sansyrox
Copy link
Member

If it as opt-in what would be the constant part?

@JackThomson2
Copy link
Contributor Author

The response of the functions, as I say in the Hello world, we'd just save that.

@JackThomson2
Copy link
Contributor Author

An example for this could be returning the static index page etc. If it's always returning index there would be no point checking the python function every time

@sansyrox
Copy link
Member

@JackThomson2 , I understand your proposal now. I think it will be a good addition and can make the response time faster. Also, I have something in mind that will allow us to use the decorator python syntax with it.

@sansyrox
Copy link
Member

I also will be implementing static file serving after merging your PR. That will be using native rust only imo.

@sansyrox
Copy link
Member

@JackThomson2 , is this request relevant after the v0.6.0 release?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants