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

Non-Generic UnaryResult #579

Merged
merged 2 commits into from
Dec 14, 2022
Merged

Non-Generic UnaryResult #579

merged 2 commits into from
Dec 14, 2022

Conversation

mayuki
Copy link
Member

@mayuki mayuki commented Dec 13, 2022

This PR introduces non-generic UnaryResult.

Non-generic UnaryResult is the return type of a service method that does not return a value.
It replaces UnaryResult<Nil>, which is similar to Task and ValueTask.

Example

// Shared interface:
public interface IMyService : IService<IMyService>
{
    UnaryResult MethodAsync(int arg0);
}

// Server-side:
public class MyService : ServiceBase<IMyService>, IMyService
{
    public async UnaryResult MethodAsync(int arg0)
    {
        // Do something ...
        // The method does not return any value. (like void, ValueTask, Task)
    }
}

// Client-side:
await client.MethodAsync(1234);

Breaking changes

UnaryResult has changed from static class to struct.

@mayuki mayuki marked this pull request as ready for review December 13, 2022 10:02
@mayuki mayuki mentioned this pull request Dec 13, 2022
28 tasks
@mayuki mayuki merged commit d7fc873 into 5.0 Dec 14, 2022
@mayuki mayuki deleted the feature/UnaryResultNonGeneric branch December 14, 2022 01:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant