简体   繁体   English

在Twitter Finagle中是客户端线程安全的

[英]is client thread-safe in Twitter Finagle

Is the the client in Twitter Finagle thread-safe ? Twitter Finagle中的客户端是否是线程安全的? I don't want to call newClient in each RPC function (I think it will make a new connection to destination end, is it?) So it seems that re-using the same client object is a good choice. 我不想在每个RPC函数中调用newClient(我认为它会建立到目标端的新连接,是吗?)所以似乎重新使用相同的客户端对象是一个不错的选择。 But, because the RPC functions may be called by diff threads at the same time, is it safe to use the same Finagle client object ? 但是,因为RPC函数可能同时被diff线程调用,所以使用相同的Finagle客户端对象是否安全?

This is client-specific. 这是特定于客户的。 All clients exported by Finagle are thread-safe, but your own clients may not be if you don't design them to be. Finagle导出的所有客户端都是线程安全的,但如果您不设计它们,您自己的客户可能不是。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM