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

Add new createProxy method on PrxHelper #2128

Merged
merged 3 commits into from
May 8, 2024

Conversation

bernardnormier
Copy link
Member

This PR adds a new createProxy static method on PrxHelper classes.

createProxy creates a proxy from a communicator and a proxy string. It's about simplifying this boilerplate code:

// old
using var communicator = Ice.Util.initialize(ref args);
var greeter = GreeterPrxHelper.uncheckedCast(
    communicator.stringToProxy("greeter:default -h localhost -p 10000"));

or

// old
using var communicator = Ice.Util.initialize(ref args);
var greeter = GreeterPrxHelper.checkedCast(
    communicator.stringToProxy("greeter:default -h localhost -p 10000"));

to:

// new, preferred
using var communicator = Ice.Util.initialize(ref args);
var greeter = GreeterPrxHelper.createProxy(
    communicator,
    "greeter:default -h localhost -p 10000");

I also updated the Ice/ami and Ice/operations tests to use this new syntax.

@bernardnormier bernardnormier requested review from pepone and externl May 7, 2024 18:48
Copy link
Member

@externl externl left a comment

Choose a reason for hiding this comment

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

Looks good!

@bernardnormier bernardnormier merged commit bffe2e7 into zeroc-ice:main May 8, 2024
16 checks passed
@bernardnormier bernardnormier deleted the create-proxy branch May 10, 2024 23:44
InsertCreativityHere pushed a commit to InsertCreativityHere/compiler-comparison that referenced this pull request Jan 1, 2025
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