Skip to content

Conversation

@bernardnormier
Copy link
Member

In other words, remove "amd" from the demos.

// internal session state maintained by the Glacier router.
Console.WriteLine("Destroying the session...");
await pokeSession.ice_getCachedConnection()!.closeAsync();
await pokeSession.destroyAsync();
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works fine now that the destroyAsync implementation waits for the router to destroy its session.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates the C# demos to use async skeletons instead of AMD, aligning Slice definitions and server implementations with the async pattern.

  • Remove AMD annotations from Slice files and delete AMD-specific Slice files.
  • Switch servant base classes from GreeterDisp_/PokeSessionDisp_ to AsyncGreeterDisp_/AsyncPokeSessionDisp_ and update method signatures to async variants.
  • Update client code to explicitly destroy sessions via destroyAsync instead of closing connections.

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
csharp/Ice/Greeter/slice/GreeterAMD.ice Removed AMD-specific Slice definition to eliminate AMD usage.
csharp/Ice/Greeter/ServerAMD/ServerAMD.csproj Points SliceCompile to Greeter.ice instead of GreeterAMD.ice.
csharp/Ice/Greeter/ServerAMD/Chatbot.cs Uses AsyncGreeterDisp_ and updates comments; implements GreetAsync.
csharp/Ice/Cancellation/slice/Greeter.ice Removes ["amd"] annotation from interface operation.
csharp/Ice/Cancellation/Server/Chatbot.cs Switches servant base to AsyncGreeterDisp_.
csharp/Glacier2/Session/Server/DefaultPokeSession.cs Migrates to AsyncPokeSessionDisp_; updates methods to async versions and awaits destruction.
csharp/Glacier2/Session/Client/Program.cs Replaces connection close with pokeSession.destroyAsync().

/// <inheritdoc/>
// Implements the abstract method GreetAsync from the GreeterDisp_ class generated by the Slice compiler.
// Implements the abstract method GreetAsync from the AsyncGreeterDisp_ class generated by the Slice compiler.
// This version uses the Asynchronous Method Dispatch (AMD) variant.
Copy link

Copilot AI Oct 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment still references AMD, but this servant now uses the async skeleton (AsyncGreeterDisp_) rather than the AMD attribute. Update the comment to avoid the AMD terminology.

Suggested change
// This version uses the Asynchronous Method Dispatch (AMD) variant.
// This version uses the asynchronous skeleton (AsyncGreeterDisp_) generated by the Slice compiler.

Copilot uses AI. Check for mistakes.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This version uses the Asynchronous Method Dispatch (AMD) variant.

Overall I find this sentence confusing.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will fix in a follow-up PR.

/// <inheritdoc/>
// Implements the abstract method GreetAsync from the GreeterDisp_ class generated by the Slice compiler.
// Implements the abstract method GreetAsync from the AsyncGreeterDisp_ class generated by the Slice compiler.
// This version uses the Asynchronous Method Dispatch (AMD) variant.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This version uses the Asynchronous Method Dispatch (AMD) variant.

Overall I find this sentence confusing.

@bernardnormier bernardnormier merged commit 7d928a2 into zeroc-ice:main Oct 15, 2025
16 checks passed
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.

3 participants