private Metadata.IResponse HandleMetadataRequest(Metadata.IRequest req) { switch (req) { case Metadata.ListTopics _: return(new Metadata.Topics(Try <List <TopicMetadata> > .From(() => _adminClient.GetMetadata(_settings.MetadataRequestTimeout).Topics))); default: throw new InvalidOperationException($"Unknown metadata request: {req}"); } }
private Metadata.IResponse HandleMetadataRequest(Metadata.IRequest req) { switch (req) { case Metadata.ListTopics _: return(new Metadata.Topics(Try <List <TopicMetadata> > .From(() => { using (var adminClient = new DependentAdminClientBuilder(_consumer.Handle).Build()) { return adminClient.GetMetadata(_settings.MetadataRequestTimeout).Topics; } }))); default: throw new InvalidOperationException($"Unknown metadata request: {req}"); } }