Thrift

233 阅读1分钟

ref:

一个简单的 thrift 接口定义,simple.thift

service SimpleService {
    void parse();
}

thrift 可以根据 simple.thrift 文件生成中间代码:

thrift --gen java

生成的 java 代码中与客户端相关的包括下面几部分(省略了具体内容):

public class SimpleService {
    public interface Iface {}
    public interface AsyncIface {}
    
    public static class Client {}
    public static class AsyncClient {}   
}

在 intellij 中可以查看 uml 图, image.png

image.png