Skip to main content

WithTaskType

Gets a new context with TaskType set.

def WithTaskType(
ctx: context.Context,
taskType: string
) - > context.Context

Gets a new context with TaskType set. This function is used to associate a specific task type with a context, allowing downstream operations to identify and act upon the nature of the task.

Parameters

NameTypeDescription
ctxcontext.ContextThe parent context to which the task type will be added.
taskTypestringThe string representing the type of task to associate with the context.

Returns

TypeDescription
context.ContextA new context derived from the input context, with the specified task type value associated.