Skip to content
Newer
Older
100644 25 lines (21 sloc) 824 Bytes
904d518 fixed documentation bug in haxe_sample.yaws
Yariv Sadan authored
1 <erl module=haxe_sample>
b503fa4 Export haXe remoting handler function
Paul Hampson authored
2 -export([respond/2]).
904d518 fixed documentation bug in haxe_sample.yaws
Yariv Sadan authored
3
7811247 @vinoski whitespace cleanup
vinoski authored
4 out(A) ->
0be3c7e @klacke untabified all of yaws
authored
5 A1 = A#arg{state = {new_state, "alive and kicking"}},
6 yaws_rpc:handler(A1, {haxe_sample, respond}).
904d518 fixed documentation bug in haxe_sample.yaws
Yariv Sadan authored
7
48c117d Add example for haXe returning an error object
Paul Hampson authored
8 respond(State, {call, failure, Value} = _Request) ->
9 { false, { error, { struct, [ { message, "Failure" }, { code, 500 } ] } } };
10
904d518 fixed documentation bug in haxe_sample.yaws
Yariv Sadan authored
11 respond(State, {call, echo, Value} = _Request) ->
0be3c7e @klacke untabified all of yaws
authored
12 {new_state, StateVal} = State,
13 {array, [First, Second]} = Value,
14 Response =
15 {response,
16 {struct, [
17 {you_sent_first, First},
18 {btw, "Hello haXe!"},
19 {also, {array, ["take", "this", 4, "array"]}},
20 {my_state_is, StateVal}
21 ]
22 }},
23 {true, 0, null, Response}.
904d518 fixed documentation bug in haxe_sample.yaws
Yariv Sadan authored
24 </erl>
Something went wrong with that request. Please try again.