temporalio / sdk-dotnet

Temporal .NET SDK

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Feature Request] Support unsafe tracing event disabling in workflows

cretz opened this issue · comments

Describe the solution you'd like

using (Workflow.Unsafe.TracingEventsDisabled())
{
    // code
}

After further discussion, this would be better as a property that can be set

The use case for this was to support running arbitrary non-workflow async calls in workflow interceptors. However, this is trickier than it seems. If you await it may use the current task scheduler. We have found a way to do this by creating a task on the default scheduler and explicitly Waiting on it, but it's even harder to get back on the workflow scheduler if you want that.

I am closing this since the solution presented (disabling this inside a workflow) does not solve the actual problem of running outside the workflow scheduler. I can reopen if we do want to revisit this.