[概要] Ice 全能的RPC框架 - 灵活

Ice是个好东西,希望国内能普及

[概要] Ice 全能的RPC框架

Flexible[Ice官方]
灵活[Ice官方]

Ice is Flexible
Make synchronous and asynchronous invocations using TCP, UDP, SSL/TLS, WebSockets, and Bluetooth. Bidirectional connections allow a server to reuse a connection established by a client to make callbacks.
Ice 是灵活的
使用TCP,UDP,SSL / TLS,WebSockets和蓝牙实现同步和异步调用。 双向连接能力允许服务器利用客户端建立的连接进行回调。

Synchronous and Asynchronous
Ice supports both synchronous (blocking) and asynchronous (non-blocking) invocations. With a synchronous invocation, the caller's thread blocks until the RPC has completed. An asynchronous invocation allows the caller to continue using the thread while the RPC is in progress and to be notified of the result.

同步和异步调用
Ice支持同步(阻塞)和异步(非阻塞)方式的调用。同步调用,即允许调用者的线程一直阻塞到RPC完成。异步调用,即允许调用者在RPC正在处理时继续使用线程,然后通知调用者处理结果。

On the server side, Ice supports both synchronous and asynchronous dispatch. The default is synchronous dispatch, where a server's thread reads the request, then locates and executes the implementation. With an asynchronous dispatch, the server's thread gives a callback to the implementation and is immediately available for additional requests. The implementation provides the result asynchronously through the callback.

在服务器端,Ice支持同步和异步调度。 缺省值是分派(这个有点坑),即服务器的线程读取请求,然后定位并执行实现。 通过异步调度,服务器的线程提供功能实现的回调,并且可以立即用于其他请求。 通过回调实现结果的异步。

Bidirectional Connections
An Ice connection normally allows requests to flow in only one direction. If your application requires the server to make callbacks to a client, the server usually establishes a new connection to that client in order to send a callback request. Network restrictions often prevent a server from being able to create a separate connection to the client, such as when the client resides behind a firewall.

双向连接
Ice连接通常允许单向发起请求。 如果您的应用程序要求服务器对客户端进行回调,则服务器通常会建立与该客户端的新连接,以便发送回调请求。 但是网络限制通常会阻止由服务器端发起的与客户端的单独连接,比如客户端位于防火墙后面。

A bidirectional connection offers a solution. Requests may flow in both directions over a bidirectional connection, allowing a server to send callback requests to a client over the client's existing connection to the server.

如何解决这个问题?双向连接提供了一种解决方案。 请求可以通过双向连接在两个方向上流动,即允许服务器通过客户端与服务器的现有连接向客户端发送回调请求。

Code Generation
A Slice compiler will map each Slice type to a default type in the target language. You can also customize this mapping. For example, a Slice sequence becomes by default a std::vector in C++ and a String[] in Java. Slice metadata allows you to generate another compatible type, such as std::list in C++ and java.util.List in Java.

代码生成
Slice编译器会将每个Slice类型映射到目标语言中的原生类型。 您还可以自定义此映射规则。 例如,Slice中的Sequence默认情况下变为C ++中的std :: vector 和Java中的String []。 当然,Slice元数据允许您生成另一个兼容类型,比如C ++中的std :: list 和Java中的java.util.List

Dynamic Invocation and Dispatch
Besides static invocation and dispatch, which rely on compiled Slice definitions, Ice supports dynamic invocation and dispatch, which delay the decision as to which types are used for communication until run time. This feature permits you to create applications (such as routers and protocol bridges) that must deal with Slice types that are unknown at compile time.

动态调用和调度
除了静态调用和调度(依赖于已经编译的Slice定义)之外,Ice还支持动态调用和调度,这会延迟决定在运行时使用哪些类型进行通信。 此功能允许您创建必须处理编译时未知的Slice类型的应用程序(如路由器和协议桥)。

如果觉得我的文章对您有用,请随意打赏。您的支持将鼓励我继续创作!

你可能感兴趣的:([概要] Ice 全能的RPC框架 - 灵活)