Skip to content
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

Proposal: Support cancellation tokens for non-remoted actor interfaces #1201

Closed
philliphoff opened this issue Dec 4, 2023 · 1 comment · Fixed by #1202
Closed

Proposal: Support cancellation tokens for non-remoted actor interfaces #1201

philliphoff opened this issue Dec 4, 2023 · 1 comment · Fixed by #1202
Assignees
Labels
area/actor kind/enhancement New feature or request
Milestone

Comments

@philliphoff
Copy link
Contributor

Describe the proposal

With #1158, actor clients would have the ability to create actor interfaces that support cancellation tokens, even if the interface used by the actor implementation did not. However, if the actor client interface does use cancellation tokens, the actor implementation cannot use that same interface for its own implementation, as the non-remoted actor proxy does not support them.

This proposal would add support for cancellation tokens in interfaces when invoking actors through the non-remoted actor proxy. Adding this support will allow actor implementations the option of sharing the same interfaces as generated clients and is a precursor to (future) support for the generation of actor implementations.

This support would allow methods of the forms:

public interface IMyActor : IActor
{
  Task NoArgumentsAsync();
  Task NoCancellationAsync(MyArgument argument);
  Task NoArgumentsButCancellationAsync(CancellationToken cancellationToken);
  Task OneArgumentAndCancellationAsync(MyArgument argument, CancellationToken cancellationToken);
}

⚠️ The remoting-based actor proxy cannot be used with interfaces with cancellation tokens. That is, it is a non-goal (for now) to support cancellation tokens using remoting. Use of cancellation tokens would be an explicit choice for actors to always use non-remoting clients (such as the generated client interfaces).

@philliphoff
Copy link
Contributor Author

/assign

@halspang halspang added kind/enhancement New feature or request area/actor labels Dec 5, 2023
@halspang halspang added this to the v1.13 milestone Dec 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/actor kind/enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants