Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into snowden/after-func
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelSnowden committed Jul 13, 2023
2 parents 94ad44f + cc38a41 commit a8b5a8f
Show file tree
Hide file tree
Showing 17 changed files with 685 additions and 446 deletions.
692 changes: 387 additions & 305 deletions api/historyservice/v1/request_response.pb.go

Large diffs are not rendered by default.

135 changes: 88 additions & 47 deletions api/token/v1/message.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

76 changes: 76 additions & 0 deletions common/tasktoken/token.go
@@ -0,0 +1,76 @@
// The MIT License
//
// Copyright (c) 2020 Temporal Technologies Inc. All rights reserved.
//
// Copyright (c) 2020 Uber Technologies, Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

package tasktoken

import (
v11 "go.temporal.io/server/api/clock/v1"
tokenspb "go.temporal.io/server/api/token/v1"
)

func NewWorkflowTaskToken(
namespaceID string,
workflowID string,
runID string,
scheduledEventID int64,
startedEventId int64,
attempt int32,
clock *v11.VectorClock,
version int64,
) *tokenspb.Task {
return &tokenspb.Task{
NamespaceId: namespaceID,
WorkflowId: workflowID,
RunId: runID,
ScheduledEventId: scheduledEventID,
StartedEventId: startedEventId,
Attempt: attempt,
Clock: clock,
Version: version,
}
}

func NewActivityTaskToken(
namespaceID string,
workflowID string,
runID string,
scheduledEventID int64,
activityId string,
activityType string,
attempt int32,
clock *v11.VectorClock,
version int64,
) *tokenspb.Task {
return &tokenspb.Task{
NamespaceId: namespaceID,
WorkflowId: workflowID,
RunId: runID,
ScheduledEventId: scheduledEventID,
ActivityType: activityType,
Attempt: attempt,
ActivityId: activityId,
Clock: clock,
Version: version,
}
}
Expand Up @@ -176,6 +176,7 @@ message RecordWorkflowTaskStartedResponse {
map<string, temporal.api.query.v1.WorkflowQuery> queries = 14;
temporal.server.api.clock.v1.VectorClock clock = 15;
repeated temporal.api.protocol.v1.Message messages = 16;
int64 version = 17;
}

message RecordActivityTaskStartedRequest {
Expand All @@ -198,6 +199,7 @@ message RecordActivityTaskStartedResponse {
temporal.api.common.v1.WorkflowType workflow_type = 6;
string workflow_namespace = 7;
temporal.server.api.clock.v1.VectorClock clock = 8;
int64 version = 9;
}

message RespondWorkflowTaskCompletedRequest {
Expand Down
1 change: 1 addition & 0 deletions proto/internal/temporal/server/api/token/v1/message.proto
Expand Up @@ -62,6 +62,7 @@ message Task {
string activity_type = 8;
temporal.server.api.clock.v1.VectorClock clock = 9;
int64 started_event_id = 10;
int64 version = 11;
}

message QueryTask {
Expand Down

0 comments on commit a8b5a8f

Please sign in to comment.