Skip to content
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

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Conversation

bbakerman
Copy link
Member

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

*/
public static <K, V> Orchestrator<K, V> orchestrate(DataLoader<K, V> dataLoader) {
return new Orchestrator<>(new Tracker(), dataLoader);
}
Copy link
Member Author

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;
}
Copy link
Member Author

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();
Copy link
Member Author

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);
}
});
}
Copy link
Member Author

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);
}
});
Copy link
Member Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants