Files
tasks/service/matching/physical_task_queue_manager_interface.go
Alex ShtinandGitHub 8e8f1b0f7c Remove license header from every file (#7689)
## What changed?
<!-- Describe what has changed in this PR -->
Remove license header from every file. Because it is really hard to
follow in this PR here is the summary:
1. License header is removed from all `.go` and `.proto` files
:fireworks::fireworks:🎆.
2. `LICENSE` file in the root directory has only Temporal and Uber
copyrights.
3. 5 other `LICENSE` files added to the packages which have copyrights
different from Temporal and Uber: Datadog, Xargin, "Mat Ryer, Tyler
Bunnell and contributors".
4. `license_file` flag is removed from all code generation tools.
5. `copyright_file` flag is removed from `go:generate mockgen`
directive.
6. All copyright related targets are removed from `Makefile`.
7. Updated Temporal copyright year to 2025 everywhere.

## Why?
<!-- Tell your future self why have you made these changes -->
I double checked with legal department that it is not needed to have
license header in every file. One file per repo is enough. I put all
copyrights to the root `LICENSE` file and removed header from all other
files. Also updated tools and `Makefile`.
2025-05-01 18:50:21 -07:00

59 lines
3.1 KiB
Go

//go:generate mockgen -package $GOPACKAGE -source $GOFILE -destination physical_task_queue_manager_mock.go
package matching
import (
"context"
"time"
taskqueuepb "go.temporal.io/api/taskqueue/v1"
"go.temporal.io/server/api/matchingservice/v1"
persistencespb "go.temporal.io/server/api/persistence/v1"
taskqueuespb "go.temporal.io/server/api/taskqueue/v1"
)
type (
physicalTaskQueueManager interface {
Start()
Stop(unloadCause)
WaitUntilInitialized(context.Context) error
// PollTask blocks waiting for a task Returns error when context deadline is exceeded
// maxDispatchPerSecond is the max rate at which tasks are allowed to be dispatched
// from this task queue to pollers
PollTask(ctx context.Context, pollMetadata *pollMetadata) (*internalTask, error)
// MarkAlive updates the liveness timer to keep this physicalTaskQueueManager alive.
MarkAlive()
// TrySyncMatch tries to match task to a local or remote poller. If not possible, returns false.
TrySyncMatch(ctx context.Context, task *internalTask) (bool, error)
// SpoolTask spools a task to persistence to be matched asynchronously when a poller is available.
SpoolTask(taskInfo *persistencespb.TaskInfo) error
// TODO(pri): old matcher cleanup
ProcessSpooledTask(ctx context.Context, task *internalTask) error
// DispatchSpooledTask dispatches a task to a poller. When there are no pollers to pick
// up the task, this method will return error. Task will not be persisted to db
// TODO(pri): old matcher cleanup
DispatchSpooledTask(ctx context.Context, task *internalTask, userDataChanged <-chan struct{}) error
AddSpooledTask(task *internalTask) error
AddSpooledTaskToMatcher(task *internalTask)
UserDataChanged()
// DispatchQueryTask will dispatch query to local or remote poller. If forwarded then result or error is returned,
// if dispatched to local poller then nil and nil is returned.
DispatchQueryTask(ctx context.Context, taskId string, request *matchingservice.QueryWorkflowRequest) (*matchingservice.QueryWorkflowResponse, error)
// DispatchNexusTask dispatches a nexus task to a local or remote poller. If forwarded then result or
// error is returned, if dispatched to local poller then nil and nil is returned.
DispatchNexusTask(ctx context.Context, taskId string, request *matchingservice.DispatchNexusTaskRequest) (*matchingservice.DispatchNexusTaskResponse, error)
UpdatePollerInfo(pollerIdentity, *pollMetadata)
GetAllPollerInfo() []*taskqueuepb.PollerInfo
HasPollerAfter(accessTime time.Time) bool
// LegacyDescribeTaskQueue returns pollers info and legacy TaskQueueStatus for this physical queue
LegacyDescribeTaskQueue(includeTaskQueueStatus bool) *matchingservice.DescribeTaskQueueResponse
GetStats() *taskqueuepb.TaskQueueStats
GetInternalTaskQueueStatus() []*taskqueuespb.InternalTaskQueueStatus
UnloadFromPartitionManager(unloadCause)
QueueKey() *PhysicalTaskQueueKey
// MakePollerScalingDecision makes a decision on whether to scale pollers up or down based on the current state
// of the task queue and the task about to be returned.
MakePollerScalingDecision(pollStartTime time.Time) *taskqueuepb.PollerScalingDecision
}
)