-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Temporal Worker Wrapper #2368
Temporal Worker Wrapper #2368
Conversation
@@ -52,33 +60,49 @@ public WorkerRun create(Job job) { | |||
return WorkerRun.create(workspaceRoot, job.getId(), attemptId, createSupplier(job, attemptId)); | |||
} | |||
|
|||
@SuppressWarnings("UnnecessaryDefault") | |||
@SuppressWarnings({"UnnecessaryDefault", "CodeBlock2Expr"}) |
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.
the formatting makes this really hard to read if you don't have the return statements (even though the bracket-less lambda syntax is technically possible in this case).
cd59d03
to
6a65ad1
Compare
* outputs are passed to the selected worker. It also makes sures that the outputs of the worker are | ||
* persisted to the db. | ||
*/ | ||
public class TemporalAttemptExecution<T> implements CheckedSupplier<T, TemporalJobException> { |
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 wanted to with a base temporal activity that could be extend to maximize how much code we could de-duplicate, but i couldn't find a version of it that i liked. it is particularly tricky given the interfaces that you need to work around with temporal. instead I did the TemporalAttemptExecution
wrapper.
1162859
to
df09fa0
Compare
df09fa0
to
6a90ebb
Compare
What
Worker
s when executed in Temporal. Specifically move all the logic for 1. job root / log paths 2. MDCs 3. error handling in one place, so it can all be tested once.How
Worker
s inTemporalAttemptExecution
.Pre-merge Checklist
Recommended reading order
TemporalAttemptExecution.java