Closed bernardnormier closed 1 year ago
I also find the previous setup simpler.
I agree that the current code is simpler.
In the existing server boilerplate, main blocks until the communicator shutdown is completed, and various events (Ctrl+C, the shutdown operation) initiate the communicator shutdown.
In this revised version, the Ice runtime is no longer involved in this logic: main blocks until the application calls "requestShutdown", and requestShutdown does not call the Ice runtime.
In this revised version, the Ice runtime is no longer involved in this logic: main blocks until the application calls "requestShutdown", and requestShutdown does not call the Ice runtime.
But why no longer use waitForShutdown
since the runtime still provides it and it's not (yet?) deprecated? If we change this here, we'll have to fix all the demos in all language mappings that use this shutdown pattern. I'd rather revisit this with 3.8.
This PR reworks the hello Server to "wait for shutdown" using a promise/future.
It's a draft PR because if we decide to adopt this new model for cpp11 servers, we should update all the demos, not just the hello demo.