一個簡化遠程數據訪問的 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 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!