-
Notifications
You must be signed in to change notification settings - Fork 112
Add interceptor methods: onNextRendering, onSnapshotTree #952
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
Conversation
181d348 to
73fbacc
Compare
workflow-core/src/commonMain/kotlin/com/squareup/workflow1/WorkerWorkflow.kt
Outdated
Show resolved
Hide resolved
...acing/src/main/java/com/squareup/workflow1/diagnostic/tracing/TimelineWorkflowInterceptor.kt
Outdated
Show resolved
Hide resolved
73fbacc to
baa8f1a
Compare
workflow-core/src/commonMain/kotlin/com/squareup/workflow1/Worker.kt
Outdated
Show resolved
Hide resolved
| override fun toString(): String = | ||
| WorkflowIdentifierTypeNamer.uniqueName(EmitWorkerOutputAction::class) + | ||
| "(worker=$worker, key=\"$renderKey\")" | ||
| "(worker=$worker, key=$renderKey)" |
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 typically don't use " in logged names.
9364383 to
16b82d6
Compare
16b82d6 to
7622589
Compare
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.
Could you add a commit message explaining why this is needed, what use case it unlocks?
| ): S = proceed(old, new, state) | ||
|
|
||
| /** | ||
| * Intercept calls to [com.squareup.workflow1.internal.WorkflowRunner.nextRendering]. |
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.
| * Intercept calls to [com.squareup.workflow1.internal.WorkflowRunner.nextRendering]. | |
| * Intercept calls to [WorkflowRunner.nextRendering][com.squareup.workflow1.internal.WorkflowRunner.nextRendering]. |
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 definitely needs kdoc here as we are intercepting an internal method in the Runner.
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.
done
| ): S = proceed(old, new, state) | ||
|
|
||
| /** | ||
| * Intercept calls to [com.squareup.workflow1.internal.WorkflowRunner.nextRendering]. |
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 definitely needs kdoc here as we are intercepting an internal method in the Runner.
| /** | ||
| * Intercept calls to [StatefulWorkflow.snapshotState] including the children calls. | ||
| */ | ||
| public fun onSnapshotTree( |
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 a bit confusing. Why not onSnapshotStateWithChildren? Also could use kdoc explaining use case.
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.
done
7622589 to
6dd59b3
Compare
|
|
||
| override val realIdentifier: WorkflowIdentifier = unsnapshottableIdentifier(workerType) | ||
| override fun describeRealIdentifier(): String = "worker $workerType" | ||
| override fun describeRealIdentifier(): String = workerType.toString() |
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 workers have names that make it clear they're workers, no need for this.
| } | ||
| } | ||
|
|
||
| override fun toString() = debugString |
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.
Removing WorkflowNodeId(identifier=foo, name=bar) to just foo and foo named bar
|
Still would like to see a commit message explaining what use case this unlocked. |
|
@pyricau you can use |
6dd59b3 to
53ae4eb
Compare
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.
LGTM
Also removing noise from some of the toString()
53ae4eb to
7ed7aff
Compare
Also removing noise from some of the toString()