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

Remove SliceD methods #3738

Open
bernardnormier opened this issue Oct 21, 2023 · 0 comments
Open

Remove SliceD methods #3738

bernardnormier opened this issue Oct 21, 2023 · 0 comments
Labels
proposal Proposal for a new feature or significant update slice-cs code generator
Milestone

Comments

@bernardnormier
Copy link
Member

We should look into removing SliceD methods, like #3737 removes ProtobufD methods.

For example:

   [SliceOperation("opWithMultipleParametersAndReturnValues")]
    [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
    protected static async global::System.Threading.Tasks.ValueTask<IceRpc.OutgoingResponse> SliceDOpWithMultipleParametersAndReturnValuesAsync(
        IMyOperationsAService target,
        IceRpc.IncomingRequest request,
        global::System.Threading.CancellationToken cancellationToken)
    {
        request.CheckNonIdempotent();
        var args = await Request.DecodeOpWithMultipleParametersAndReturnValuesAsync(request, cancellationToken).ConfigureAwait(false);
        var returnValue = await target.OpWithMultipleParametersAndReturnValuesAsync(args.P1, args.P2, request.Features, cancellationToken).ConfigureAwait(false);
        return new IceRpc.OutgoingResponse(request)
        {
            Payload = Response.EncodeOpWithMultipleParametersAndReturnValues(returnValue.R1, returnValue.R2, request.Features.Get<ISliceFeature>()?.EncodeOptions),
            PayloadContinuation = null
        };
    }

The idea is for the source generator to generate equivalent code in the DispatchAsync "switch/case". We'd generate Request.DecodeXxx and Response.EncodeXxx with slice-cs as usual.

If needed, we could add additional information in the SliceOperationAttribute.

@bernardnormier bernardnormier added proposal Proposal for a new feature or significant update slice-cs code generator labels Oct 21, 2023
@bernardnormier bernardnormier modified the milestones: 0.2.0, Future Oct 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
proposal Proposal for a new feature or significant update slice-cs code generator
Projects
None yet
Development

No branches or pull requests

1 participant