zabetak commented on pull request #2698:
URL: https://github.com/apache/calcite/pull/2698#issuecomment-1026735660


   > a colleague of mine has raised a concern that recreating the RestClient 
for every request, as I've done in this iteration, might negatively affect 
effeciency. It would be nice to get your thoughts on this.
   
   This might be true but talking about efficiency when there are resource 
leaks is a secondary concern.
   
   I guess you can tackle both efficiency and life-cycle management by 
introducing a wrapper interface around the `RestClient#performRequest` (e.g., 
`RequestExecutor`). The new interface should be responsible for managing the 
clients; one implementation could choose to create and destroy a client after 
every request just the way you do here where another could use the same client 
for multiple requests and release resources when certain time passes or some 
other event occurs.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to