在iPhone上使用Apache Thrift是否成功? [英] Any success using Apache Thrift on iPhone?

查看:165
本文介绍了在iPhone上使用Apache Thrift是否成功?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人在iPhone应用程序中完成或看到 Apache Thrift 的部署吗?

Has anybody done or seen a deployment of Apache Thrift in an iPhone app?

我想知道与HTTP相比,对于iPhone而言,高容量,低延迟网络服务是否是合理的解决方案.

I am wondering if is a reasonable solution for a high-volume, low(er)-latency network service for iPhones compared to HTTP.

我发现的一件值得注意的事情是关于在Thrift上运行Thrift的错误报告. iPhone,它似乎已经修复.但这并不一定表示这已经完成.

One noteworthy thing I found is a bug report about running Thrift on the iPhone, which seems to have been fixed. But that doesn't necessarily indicate that it's a done deal.

推荐答案

只需两美分..

对此问题的公认答案是不使用技术的观点,而不是是否可行的答案.

The accepted answer to this question, is an opinion to not use a technology, not an answer of whether it is possible.

Thrift是一种接口定义语言IDL,例如Protobuf和Capt'n'Proto.它们允许定义与平台无关的客户端/服务器/服务器协议. JSON和Plist没有提供相同级别的类型一致性.

Thrift, is an interface definition language, IDL, like Protobuf and Capt'n'Proto. They permit the definition of a client/server/server protocol which is platform agnostic. JSON and Plist don't provide the same level of type conformance.

我以前曾带领iOS团队使用Google Protobuf v2.5在iOS,Android,Windows和服务器团队上使用10Ms的MAU,我可以证明IDL在移动设备方面非常出色. Apple使用它们来同步iWork内容.

Having previously lead an iOS team with 10Ms MAU using Google Protobuf v2.5 on iOS, Android, Windows, and server teams, I can attest that IDLs are great on mobile. Apple uses them for syncing iWork content.

我目前的团队将Thrift用于iOS和Android客户端,主要使用Scala后端.我更喜欢Protobuf.

My current team uses Thrift for iOS and Android clients, with a mostly Scala backend. I much prefer it to Protobuf.

我们通过HTTPS和WebSocket发送Thrift有效负载.一旦(在Thrift中)定义了我们的有线通信协议(即框架结构),就很容易开发您的API.

We send Thrift payloads over HTTPS and WebSockets. Once you have defined (in Thrift) your our wire communication protocol (i.e. frame structure), it's very easy to evolve your APIs.

但是,尤其是在iOS上,存在一些实现问题.该库的当前版本包装得很差,如果您希望创建一个Objective-C框架(例如,对于iOS 8+),那么v0.9.2将无法使用.这是因为库标头包含本地导入(#import "TProtocol.h"而不是#import <Thrift/TProtocol.h>)而没有伞形标头.最糟糕的是,Objective-C编译器会生成非常混乱的Objective-C类,其中还包括Thrift库中的本地导入.

However, on iOS in particular there are some implementation issues. The current version of the library is quite poorly packaged, and if you hope to make an Objective-C framework (e.g. for iOS 8+), then you will not be able to out of the box with v0.9.2. This is because the library headers include local imports, (#import "TProtocol.h" instead of #import <Thrift/TProtocol.h>) with no umbrella headers. Worst of all, the Objective-C compiler generates very messy Objective-C classes, also including local imports from the Thrift library.

其中一些问题真是该死.它向我表明,尽管IDL的使用是一个很好的工程决策,但并不是很多iOS团队都在使用Thrift,除非他们有足够的资源来编写自己的库.

Some of these issues are pretty damning. It indicates to me that while use of an IDL is very much a good engineering decision, not many iOS teams are using Thrift, unless they're huge with the resources to write their own library.

这篇关于在iPhone上使用Apache Thrift是否成功?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆