You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Greg has shown us a runner that expects an interface to run konnectors that would be coupled to a runner that would orchestrate the run of a konnector. This decouples the instrumentation (LOGIN_OK, LOGIN_FAILED, SYNC_SUCCESSFUL) of the konnector from its implementation.
It also enables a possible batch runner to run simultaneously konnectors.
The text was updated successfully, but these errors were encountered:
ptbrowne
changed the title
Konnectors should export a Spider instead of running code directly
Konnectors should be run through a runner from cozy-konnector-libs instead of running code directly
Feb 22, 2018
Thanks for opening this issue @ptbrowne. What I had in mind was to use an inversion of control pattern. The idea is to let cozy-konnector-libs run the konnectors in a way or another.
This could improve
konnector development (less code for contributor, less dependencies and no instanciation)
testing and mocking (cozy-konnector-libs could provide a set of tests to validate a konnector signature, or test directly a call by mocking internal method for fetching for example)
My first POC is on this branch on the debug konnector. I also started a full working example for Trainline but the code is not in the computer I am working with right now. I will share this example in one week.
Yes I am OK with the inversion of control. This is what is shown with the run function. At the end, it would not be the user that would directly call it. The user of cozy-konnector-libs would only export the interface. We would at first expose the run function to have a smooth transition path.
Greg has shown us a runner that expects an interface to run konnectors that would be coupled to a runner that would orchestrate the run of a konnector. This decouples the instrumentation (LOGIN_OK, LOGIN_FAILED, SYNC_SUCCESSFUL) of the konnector from its implementation.
The
run
function then can instrument the konnector without changing its implementation.It also enables a possible batch runner to run simultaneously konnectors.
The text was updated successfully, but these errors were encountered: