register method
Register the resource with the Nitric server. Handles shutting down the channel.
Implementation
Future<void> register() async {
await ClientChannelSingleton.useClient($p.ResourcesClient.new,
(client) async {
var res = asRequest();
await client.declare(res);
_registrationCompletion.complete(res.id);
});
}