> Not if you want to use distributed erlang.
does it mean that it is possible with distributed erlang.

Currently I have such code:



do(Q) ->
    F = fun() -> qlc:e(Q) end,
    {atomic, Val} = mnesia:transaction(F),

keyval(K,L) ->
    {value, {K, V}} = lists:keysearch(K,1,L),

-record(suggest, {prefix, top_words}).

out(A) ->
    Arg = yaws_api:parse_query(A),

    %% search_words
    Prefix = keyval("search_words", Arg),
    SearchWords = do(qlc:q([X#suggest.top_words || X <- mnesia:table(suggest),
                            X#suggest.prefix =:= Prefix ])),

       {pre,[], f("~p", [SearchWords])}

Will you please show a simple example to do distributed erlang?


On Wed, Aug 26, 2009 at 5:30 PM, Januar V. Simarmata (G!) <januarvs@gmail.com> wrote:

On Sun, Aug 23, 2009 at 4:24 AM, Claes Wikstrom <klacke@tail-f.com> wrote:
Januar V. Simarmata (G!) wrote:

I have created an Mnesia database in node' jvs01'.

Then I run Yaws with 'nohost@nonode'.

Is there any way to open the table in node jvs01 from Yaws script?

Not if you want to use distributed erlang. If you - as you write -
choose to not use distribution, you must set up regular sockets
to the node and send/receive term_to_binary/1 terms on the socket.


Januar V. Simarmata

Januar V. Simarmata