Hi,
i add some code to init/0 :
init() ->
{ok, C} = eredis:start_link("127.0.0.1", "6379").
{ok, [C]}.
and my controller:
homepage('GET', []) ->
{ok, <<"OK">>} = eredis:q(C, ["SET", "foo", "bar"]),
{ok, <<"bar">>} = eredis:q(C, ["GET", "foo"]),
{output, "<strong>hello!</strong>"}.
but i got a error message:
unbound_var,'C'
how can i get the handler which is return by init/0 from my controller?
newbie need you help, TXH.
在 2012年12月27日星期四UTC+8下午1时23分39秒,Вячеслав Козлов写道:
Thank you, Tim!I decided this question. And it was very easy!
I did it this way - thanks to your tip, made the traditional way, with rebar, rebar.config added in relation to Eredis GIT, then in path /src/ downloaded eredis, added a my module gen-server that implements the API for my work with Eredis .
And all! Everything was pretty easy!
If anyone is interested, I can not describe in detail.
четверг, 27 декабря 2012 г., 1:52:54 UTC+4 пользователь Tim McNamara написал: