-
Notifications
You must be signed in to change notification settings - Fork 91
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
POC- Orchestration of DLs #179
base: master
Are you sure you want to change the base?
Conversation
*/ | ||
public static <K, V> Orchestrator<K, V> orchestrate(DataLoader<K, V> dataLoader) { | ||
return new Orchestrator<>(new Tracker(), dataLoader); | ||
} |
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.
needs injection of of the "tracker implementation" I think - maybe???
static <T> T castAs(Object o) { | ||
//noinspection unchecked | ||
return (T) o; | ||
} |
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.
generics are hard!
|
||
<KT, VT> void record(Step<KT, VT> step) { | ||
steps.add(step); | ||
tracker.incrementStepCount(); |
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.
we know how many steps we can have
System.out.println("step " + index + " returned : " + v); | ||
} | ||
}); | ||
} |
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.
This is where we can have tracker side effects to know things.
We should probably also handle exceptions by cancelling all "expectations on future load" since they will not happen
Maybe we just mark the Tracker as "exceptional"
} catch (Throwable ex) { | ||
result.encodeAndSetResult(ex); | ||
} | ||
}); |
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.
Looks a lot like the actual CompletebleFuture code foe scheduling ;)
java.util.concurrent.CompletableFuture.AsyncRun
Super POC stuff - pushed to allow others to see the ideas
This is not complete in any way - maybe it does not even belong here