Skip to content
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 @@ -61,6 +61,9 @@ message NexusTask {
// Only set when variant is `task` and the header was present with a valid value.
// Represented as an absolute timestamp.
google.protobuf.Timestamp request_deadline = 3;
// The endpoint this request was addressed to. Extracted from the request for convenient access.
// Only set when variant is `task`.
string endpoint = 4;
}

message CancelNexusTask {
Expand Down
9 changes: 9 additions & 0 deletions crates/sdk-core/src/worker/nexus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,13 @@ where
}
}

let endpoint = t
.resp
.request
.as_ref()
.map(|r| r.endpoint.clone())
.unwrap_or_default();

let (service, operation, request_kind) = t
.resp
.request
Expand Down Expand Up @@ -456,13 +463,15 @@ where
Some(Ok(NexusTask {
variant: Some(nexus_task::Variant::Task(t.resp)),
request_deadline,
endpoint,
}))
},
Err(e) => Some(Err(PollError::TonicError(e)))
},
TaskStreamInput::Cancel(c) => Some(Ok(NexusTask {
variant: Some(nexus_task::Variant::CancelTask(c)),
request_deadline: None,
endpoint: String::new(),
})),
TaskStreamInput::SourceComplete => {
source_done.cancel();
Expand Down
Loading