-
Notifications
You must be signed in to change notification settings - Fork 6
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
feat: sequential execution of middleware #160
Conversation
fix lint with flake8
95af3d3
to
4bb3765
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.
Please have a look at the comments. I think I would structure this differently to simplify the syntax and give an easy way to define middlewares without fallbacks. I think it would be semantically cleaner, too (and possibly also less code).
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.
Still some work needed, but we're getting there
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.
I'm really sorry to be nagging, but I really want to get this right before it's copied into proWES :-S
No Problem at all, I will fix them all in the next commit. |
POST /tasks
requestsMiddlewareException
; in the following example, proTES first attempts to applyMiddlewareClass1a
; if it works, it will advance to the next item in the outer list,MiddlewareClass2
and try to apply that; however, ifMiddlewareClass1a
raises an error, proTES will first try to applyMiddlewareClass1b
before progressing toMiddlewareClass2
:500
responsepro_tes.middleware.abstract_middleware.AbstractMiddlewareClass
; of course, any middleware class provided via external packages needs to be made available to the application (e.g., by adding the corresponding package torequirements.txt
and rebuilding the app and worker images)pro_tes.plugins.middlewares.task_distribution
with all their dependenciespro_tes.plugins.middlewares.task_distribution.distance.TaskDistributionDistance
) being attempted first, and with the random-based task-distribution (pro_tes.plugins.middlewares.task_distribution.random.TaskDistributionRandom
) serving as a fallback; this behavior can be changed by modifying themiddlewares
app configuration sectionpro_tes.plugins.middlewares.task_distribution.base.TaskDistributionBaseClass
for implementing other task distribution middlewaresMinor changes:
List
s,Dict
s andTuple
s with their lowercase counterparts across the entire applicationmypy
complaints about missing type hints/stubs in external packagesPOST /tasks
controller code as a preparatory step for a major refactoringCloses #124