Add with_thrift method to manage transport resources.