-
Notifications
You must be signed in to change notification settings - Fork 1
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
Processor catalog #19
Comments
Interesting, but why would you want to replace a step? I like the rigidity of the steps as they are now. |
Oops I did not write it explicitly up there, it mainly would be for testing so that you can swap your "mock" implementation. At the moment we need a function that does that (scans through all the step vector and replaces one by name). If we move the step declaration to a map we can just use |
I support this change, it would make testing much easier as it would be very trivial to replace the side effect steps |
To summarize this is what I am proposing. Only 1 parameter for the catalog: {:get-all-things {:fonda/type :processor
:fonda/path [:github-response]
:fonda/fn (fn [ctx]
{:status 200
:headers {"Content-Type" "application/json"}
:body {:data :loads-of}})}
:tap-all-things {:fonda/type :tap
:fonda/fn (fn [{:keys [github-response]}]
(println "the remote thing response was:" remote-thing-response))}} so that one could do Then on the runtime side, a seconda parameter would then combine the steps with something like: {:steps [:get-all-things :tap-all-things]
:runtime-ctx {:the :parameters}} This opens the door for the future - not a thing we need now: ;;; processor-1
;;; /\
;;; :processor-3 processor-4
;;; \ /
;;; processor-5
{:workflow [[:processor-1 :processor-3]
[:processor-1 :processor-4]
[:processor-3 :processor-5]
[:processor-4 :processor-5]]
:runtime-ctx {:the :parameters}} Basically we would be decoupling the declaration from the runtime behavior. It feels like a good change. It might be complicating a bit the UX but not that much actually. EDIT: the catalog could actually go in the To summarize the call: (execute config runtime-map on-success on-exception on-anomaly) Where the config is: {:catalog *the map above with declarations*
:initial-ctx ...} |
I am a little confused in what would go in the config and what would go in the runtime map. |
So let's call the input to That is for sure a runtime concern - the I am not sure about the wiring - |
I would like to proposal a quite radical, major version bump to Fonda.
The current layout of steps has two main problems IMHO:
It seems like we could find a better way to decouple step declaration with the flow. This, of course, have been already thought out by the immensely good folks that developed
onyx
and I will just post the link to their docs:http://www.onyxplatform.org/docs/user-guide/latest/#_workflow
The Catalog declares the steps. They get then combined in a workflow.
Now, we do not have the workflow requirement (yet) so I would basically just use just a
:steps
key - a list of keywords - and a map from keys names to processor or tap maps.This would make replacing implementations for testing a mere
assoc-in
away.The text was updated successfully, but these errors were encountered: