-
-
Notifications
You must be signed in to change notification settings - Fork 83
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
Refactor request handling #777
Conversation
0c821ba
to
6cacdbc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests look good + working for me locally. This is definitely a good stride towards ease-of-contribution.
It is worth noting that we used |
@scottming What if we remove The |
8b017e0
to
1778c9e
Compare
@scottming @Moosieus @scohen I think this should be ready to go. Addressed PR feedback and, based on Scott's comment, updated the first commit to pass |
1778c9e
to
e02d953
Compare
The goal of this PR is to make request handling on the server simpler and easier to understand.
The commits are mostly atomic, so reviewing commit-by-commit may be best. Notes on some of the changes:
Server.Provider.Env
, which for a long time has been a struct containing only:project
, and instead pass projects directly to handlers. This removes a level of indirection and gets rid of any confusion between it andAst.Env
.Server.Provider.Queue.Supervisor
in favor of starting aTask.Supervisor
explicitly and moving the couple helper functions directly into the module in which they're used.string | integer
, but from everything I found, implementations should not consider1 == "1"
. If there's a reason we need to do this conversion (e.g. to handle a badly-behaving client), we can add it back in, but it seemed like an unnecessary complication.Server.Provider.Queue
withServer.TaskQueue
, which just operates on IDs and MFAs. This meansTaskQueue
doesn't have to know or care about handlers. The server now finds the handler for the request before callingTaskQueue.add/2
, instead of the queue having to do it. This also means that adding to the queue always succeeds.