-
Notifications
You must be signed in to change notification settings - Fork 290
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support Add Task Activities from Abstract or Non-Sealed Class #756
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I worry a little bit about this getting messy since methods on classes aren't always going to be properly designed to handle this kind of "remoting". It seems like an area where developers could run into various issues accidentally.
Would you be willing to consider a design where classes must opt certain methods into being used as interfaces, perhaps using an attribute? For example:
public abstract class ClassClient
{
[TaskMethod]
public abstract Task<T[]> Run<T>();
}
Having developers opt in methods when designing a class makes sense, though I feel like it makes things not so transparent for a user of the class who expects to be able to invoke all available methods. |
@cgillum , just curious, when you say "methods on classes aren't always going to be properly designed to handle this kind of remoting", what do you mean? What differentiates class methods from interface methods in this context? Asides from the possibility of classes having private, protected or static methods? |
@cgillum , just checking in on this if you don't mind sharing your thoughts. |
/azp run |
EDIT: pipeline started successfully. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Thanks @cgillum. Can you help me merge it? Or how can I get access to be able to merge pull requests I create? |
This change extends
TaskHubWorker.AddTaskActivitiesFromInterface
by supporting adding activities fromabstract
or non-sealed classes.