-
-
Notifications
You must be signed in to change notification settings - Fork 318
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
Rework How IDOM Integrates With Servers #703
Conversation
5a998b6
to
dcdda61
Compare
Will need to keep in mind that readme and docs modifications will need to occur here too. I don't know if I agree with adding an app parameter to |
Here's an alternative syntax to consider, based more identically on WhiteNoise's design from sanic import Sanic
from idom.server.sanic import IdomSanic
# Configure returns a wrapped ASGI/WSGI callable
asgi_app = IdomSanic(Sanic("My App"), MyComponent, endpoint="/idom") |
I don't think IDOM has a particularly compelling reason to create provide an ASGI app, so for now I think sticking with a simple |
The only compelling reason is if you want IDOM to behave more like configurable WSGI/ASGI middleware. Fairly common design pattern in the Python web dev space. Side note, I'm assuming the reason the configure function exists is to set up the WS/HTTP endpoints, as mentioned in #653 ? |
By "compelling reason", I mean that I can't think of any methods or middleware to add to an IDOM ASGI app. And yes, the recommended way of running IDOM would be to instantiate a support application, |
Not pushing for this change, both design patterns accomplish the same task. But on the topic of middleware, it doesn't necessarily need to add methods. See |
I'm just not sure what IDOM would want to do in the I think we can stick with the |
2969a4c
to
425c531
Compare
2388ee5
to
a4c0d84
Compare
closes: #657
The change proposed here is that IDOM will expose a top-level
idom.develop
function that takes in a component definition and not much else. The configuration options here are intentionally limited since we want to push people away from using this function in production.This change will also remove
PerClientStateServer
andSharedClientStateServer
with a singleconfigure
function for each server implementation:As part of this change
SharedClientStateServer
will be removed. While it's cool, it can't be used in a production context - you need a real cross-process solution for synchronizing state (e.g. Redis).Other issues I plan to address here:
closes: #678, closes #591, closes #669, closes #657