temporalio / sdk-dotnet

Temporal .NET SDK

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Feature Request] Re-investigate signals/queries/activities as properties

cretz opened this issue · comments

Describe the solution you'd like

We initially didn't allow signals or queries as properties because we required delegates to invoke them. But now that we're using expressions we probably can. Specifically, we may want to support:

  • [WorkflowSignal] on properties with setters where the setter is invoked for the signal
  • [WorkflowQuery] on properties where the getter is invoked for the query

When [WorkflowUpdate] comes around, setting it on a property will invoke the setter and return the getter

Even activities can be properties

So we can't do signals because .NET lambda expression trees don't support assignment operators. And there's not a good reason to support activities as property getters at this time (should be clear they are methods). But workflow queries make plenty of sense as properties.