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

Pipe Worker Output Action Names #1241

Merged
merged 1 commit into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@ internal suspend fun <
) {
suspendCancellableCoroutine<Unit> { continuation ->
val resumingAction = object : WorkflowAction<PropsT, StateT, OutputT>() {
override fun toString(): String = "sendAndAwaitApplication($action)"
// Pipe through debugging name to the original action.
override val debuggingName: String
get() = action.debuggingName

override fun Updater.apply() {
// Don't execute anything if the caller was cancelled while we were in the queue.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,12 @@ internal suspend fun <OutputT> runWorker(
}

private class EmitWorkerOutputAction<P, S, O>(
private val worker: Worker<*>,
private val renderKey: String,
worker: Worker<*>,
renderKey: String,
private val output: O,
) : WorkflowAction<P, S, O>() {
override val debuggingName: String
get() = CommonKClassTypeNamer.uniqueName(EmitWorkerOutputAction::class) +
"(worker=$worker, key=$renderKey)"
override val debuggingName: String =
"EmitWorkerOutputAction(worker=$worker, key=$renderKey)"

override fun Updater.apply() {
setOutput(output)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@
{"name":"used/free memory","ph":"C","ts":0,"pid":0,"tid":0,"args":{"usedMemory":1,"freeMemory":42}},
{"name":"Snapshot","ph":"B","ts":0,"pid":0,"tid":0,"args":{}},
{"name":"Snapshot","ph":"E","ts":0,"pid":0,"tid":0,"args":{}},
{"name":"Sink received: Worker<String> (2)","cat":"update","ph":"i","ts":0,"pid":0,"tid":0,"s":"t","args":{"action":"sendAndAwaitApplication(action(com.squareup.workflow1.EmitWorkerOutputAction(worker=TypedWorker(java.lang.String (Kotlin reflection is not available)), key=)))"}},
{"name":"WorkflowAction: Worker<String> (2)","cat":"update","ph":"i","ts":0,"pid":0,"tid":0,"s":"p","args":{"action":"sendAndAwaitApplication(action(com.squareup.workflow1.EmitWorkerOutputAction(worker=TypedWorker(java.lang.String (Kotlin reflection is not available)), key=)))","oldState":"0","newState":"{no change}","output":"fired!"}},
{"name":"Sink received: Worker<String> (2)","cat":"update","ph":"i","ts":0,"pid":0,"tid":0,"s":"t","args":{"action":"action(EmitWorkerOutputAction(worker=TypedWorker(java.lang.String (Kotlin reflection is not available)), key=))"}},
{"name":"WorkflowAction: Worker<String> (2)","cat":"update","ph":"i","ts":0,"pid":0,"tid":0,"s":"p","args":{"action":"action(EmitWorkerOutputAction(worker=TypedWorker(java.lang.String (Kotlin reflection is not available)), key=))","oldState":"0","newState":"{no change}","output":"fired!"}},
{"name":"Worker<String> (2)","ph":"O","ts":0,"pid":0,"tid":0,"id":"2","args":{"snapshot":"0"}},
{"name":"Render Pass","cat":"rendering","ph":"B","ts":0,"pid":0,"tid":0,"args":{"props":"3"}},
{"name":"used/free memory","ph":"C","ts":0,"pid":0,"tid":0,"args":{"usedMemory":1,"freeMemory":42}},
Expand Down
Loading