一个简化远程数据访问的 Haskell 库:Haxl
Haxl是一个Haskell库,简化了远程数据的访问,比如数据库或基于Web的服务。 Haxl能够自动化
- batch multiple requests to the same data source,
- request data from multiple data sources concurrently,
- cache previous requests.
Having all this handled for you behind the scenes means that your data-fetching code can be much cleaner and clearer than it would otherwise be if it had to worry about optimizing data-fetching. We'll give some examples of how this works in the pages linked below.
There are two Haskell packages here:
- haxl: The core Haxl framework
- haxl-非死book(in example/非死book): An (incomplete) example data source for accessing the 非死book Graph API
To use Haxl in your own application, you will likely need to build one or more data sources: the thin layer between Haxl and the data that you want to fetch, be it a database, a web API, a cloud service, or whatever. Thehaxl-非死bookpackage shows how we might build a Haxl data source based on the existingfbpackage for talking to the 非死book Graph API.
本文由用户 lidki 自行上传分享,仅供网友学习交流。所有权归原作者,若您的权利被侵害,请联系管理员。
转载本站原创文章,请注明出处,并保留原始链接、图片水印。
本站是一个以用户分享为主的开源技术平台,欢迎各类分享!