|
@@ -35,19 +35,19 @@ info(#init{token = Auth}, Req, State) ->
|
|
|
Req, New};
|
|
|
|
|
|
info(#client{data = Message}, Req, State) ->
|
|
|
- nitro:actions([]),
|
|
|
+ erlang:put(actions, []),
|
|
|
{reply, {bert, io(#client{data = Message}, State)}, Req, State};
|
|
|
|
|
|
info(#pickle{} = Event, Req, State) ->
|
|
|
- nitro:actions([]),
|
|
|
+ erlang:put(actions, []),
|
|
|
{reply, {bert, html_events(Event, State)}, Req, State};
|
|
|
|
|
|
info(#flush{data = Actions}, Req, State) ->
|
|
|
- nitro:actions(Actions),
|
|
|
+ erlang:put(actions, Actions),
|
|
|
{reply, {bert, io(<<>>)}, Req, State};
|
|
|
|
|
|
info(#direct{data = Message}, Req, State) ->
|
|
|
- nitro:actions([]),
|
|
|
+ erlang:put(actions, []),
|
|
|
{reply, {bert,
|
|
|
case io(Message, State) of
|
|
|
{io, _, {stack, _}} = Io -> Io;
|
|
@@ -61,10 +61,10 @@ info(Message, Req, State) -> {unknown, Message, Req, State}.
|
|
|
%% double render: actions could generate actions
|
|
|
|
|
|
render_actions(Actions) ->
|
|
|
- nitro:actions([]),
|
|
|
+ erlang:put(actions, []),
|
|
|
First = nitro:render(Actions),
|
|
|
- Second = nitro:render(nitro:actions()),
|
|
|
- nitro:actions([]),
|
|
|
+ Second = nitro:render(erlang:get(actions)),
|
|
|
+ erlang:put(actions, []),
|
|
|
nitro:to_binary([First, Second]).
|
|
|
|
|
|
|
|
@@ -110,7 +110,7 @@ render_ev(#ev{module = M, name = F, msg = P, trigger = T}, _Source, Linked, Stat
|
|
|
io(Event, #cx{module = Module}) ->
|
|
|
try
|
|
|
X = Module:event(Event),
|
|
|
- {io, render_actions(nitro:actions()), X}
|
|
|
+ {io, render_actions(erlang:get(actions)), X}
|
|
|
catch E:R:S ->
|
|
|
?LOG_EXCEPTION(E, R, S),
|
|
|
{io, [], {stack, S}}
|
|
@@ -118,7 +118,7 @@ io(Event, #cx{module = Module}) ->
|
|
|
|
|
|
|
|
|
io(Data) ->
|
|
|
- try {io, render_actions(nitro:actions()), Data}
|
|
|
+ try {io, render_actions(erlang:get(actions)), Data}
|
|
|
catch E:R:S ->
|
|
|
?LOG_EXCEPTION(E, R, S),
|
|
|
{io, [], {stack, S}}
|
|
@@ -148,7 +148,7 @@ render_ev(#ev{module = M, name = F, msg = P, trigger = T}, _Source, Linked, Stat
|
|
|
io(Event, #cx{module = Module}) ->
|
|
|
try
|
|
|
X = Module:event(Event),
|
|
|
- {io, render_actions(nitro:actions()), X}
|
|
|
+ {io, render_actions(erlang:get(actions)), X}
|
|
|
catch E:R ->
|
|
|
S = erlang:get_stacktrace(),
|
|
|
?LOG_EXCEPTION(E, R, S),
|
|
@@ -157,7 +157,7 @@ io(Event, #cx{module = Module}) ->
|
|
|
|
|
|
|
|
|
io(Data) ->
|
|
|
- try {io, render_actions(nitro:actions()), Data}
|
|
|
+ try {io, render_actions(erlang:get(actions)), Data}
|
|
|
catch E:R ->
|
|
|
S = erlang:get_stacktrace(),
|
|
|
?LOG_EXCEPTION(E, R, S),
|