包括来自Riak的Erlang客户端库 [英] Including the Erlang client library from Riak in Nitrogen

查看:102
本文介绍了包括来自Riak的Erlang客户端库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚开始使用一个使用氮气的网络应用程序,一切顺利。但我也希望我的应用程序与我设置的riak数据库接口,我有一些麻烦。

i'm just starting up with a web app using nitrogen and everything is going well. But i also want my app to interface with a riak db that i set up and i'm having some trouble.

我很困惑,我如何包含erlang客户端界面,以便我的代码在氮中可以访问。

I'm confused as to how I "include" the erlang client interface so that my code in nitrogen can access it.

(https://wiki.basho.com/display/RIAK/Erlang+Client+PBC)

(https://wiki.basho.com/display/RIAK/Erlang+Client+PBC)

我是新来的erlang和氮气,但我的意思是一般来说,对于erlang来说,我如何将其他图书馆作为参考?我只是把已编辑的光束文件放在某个地方,然后在我的erlang代码的顶部添加一行 - 如果是这样,我该怎么把这些文件放入氮中(它有自己独立的erlang节点实例我想)

I'm new to erlang and nitrogen, but i mean in general, for erlang, how do i include other libraries as reference? Do i just take the compiled beam files and throw it somewhere, then have an -include line at the top of my erlang code? if so, where do do i throw these files for nitrogen (it has its own separate erlang node instance i think)

推荐答案

如果你运行一个节点上的所有东西只需要调用你所需要的。如果节点使用Erlang / OPT版本处理规则构建,则意味着所有需要的库都将加载到VM。

If you run everything on one node just call what you need. If node is build with rules of Erlang/OPT release handling it means that all needed libraries are loaded to VM.

-include只用于包含头文件,例如记录定义或宏。

-include is just used to include header files with e.g. record definitions or macros.

所有这一切都应该是透明的,因为钢筋(由basho构建系统)很好地处理它。

All of it should be transparent for you because rebar (build system by basho) handles it pretty well.

要使用某些lib,请确保它是在deps目录中,因为正确的rebar配置(deps部分)。接下来要修改配置节点的rel / files中的systools.config(从deps /中获取应用程序以包含在正在运行的系统中)。

To use some lib make sure it is in deps directory as a result of proper rebar config (deps section). The next thing is to modify systools.config in rel/files which configures node (picks up apps from deps/ to be included in running system).

这就是全部。

这篇关于包括来自Riak的Erlang客户端库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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