-
Notifications
You must be signed in to change notification settings - Fork 216
Update C# demos to use async skeletons #643
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
Conversation
| // internal session state maintained by the Glacier router. | ||
| Console.WriteLine("Destroying the session..."); | ||
| await pokeSession.ice_getCachedConnection()!.closeAsync(); | ||
| await pokeSession.destroyAsync(); |
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.
This works fine now that the destroyAsync implementation waits for the router to destroy its session.
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.
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. |
Copilot
AI
Oct 15, 2025
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.
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.
| // This version uses the Asynchronous Method Dispatch (AMD) variant. | |
| // This version uses the asynchronous skeleton (AsyncGreeterDisp_) generated by the Slice compiler. |
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.
This version uses the Asynchronous Method Dispatch (AMD) variant.
Overall I find this sentence confusing.
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.
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. |
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.
This version uses the Asynchronous Method Dispatch (AMD) variant.
Overall I find this sentence confusing.
In other words, remove "amd" from the demos.