Skip to content

Commit

Permalink
direct messages
Browse files Browse the repository at this point in the history
  • Loading branch information
5HT committed Oct 9, 2014
1 parent 35307ba commit 0b8ef0f
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion priv/n2o.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ function N2O_start() {
}

//WebSocket = undefined; // test XHR fallback
if (autoinit) N2O_start();
//if (autoinit) N2O_start();
2 changes: 1 addition & 1 deletion priv/protocols/bert.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ var $bert = {};

$bert.on = function onbert(evt, callback) // BERT formatter
{
console.log("Bert On");
// console.log("Bert On");
var reader = new FileReader();
reader.addEventListener("loadend", function() {
try {
Expand Down
2 changes: 1 addition & 1 deletion priv/protocols/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ $client.on = function onclient(evt, callback) // JSON formatter

if (typeof callback == 'function' && msg.data) callback(msg.data);

// console.log(msg.eval);
console.log(msg.eval);
if (msg.eval) try { eval(msg.eval); }
catch (e) { return { status: "error", desc: e }; }

Expand Down
4 changes: 2 additions & 2 deletions src/endpoints/n2o_websocket.erl
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

protocols() -> wf:config(n2o,protocols,[ n2o_binary,
n2o_rails,
n2o_client,
n2o_nitrogen,
n2o_heart,
n2o_client
n2o_heart
]).

% web server callbacks
Expand Down
6 changes: 3 additions & 3 deletions src/nitrogen/n2o_nitrogen.erl
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ info({flush,Actions}, Req, State) ->
wf:info(?MODULE,"Flush Message: ~p",[Actions]),
{reply, wf:json([{eval,iolist_to_binary(render_actions(Actions))}]), Req, State};

info({delivery,Route,Message}, Req, State) ->
info({direct,Message}, Req, State) ->
wf:actions([]),
Module = State#cx.module,
Term = try Module:event({delivery,Route,Message}) catch E:R -> wf:info(?MODULE,"Catch: ~p:~p~n~p", wf:stack(E, R)), <<>> end,
wf:info(?MODULE,"Delivery: ~p Result: ~p",[Message,Term]),
Term = try Module:event(Message) catch E:R -> wf:info(?MODULE,"Catch: ~p:~p~n~p", wf:stack(E, R)), <<>> end,
wf:info(?MODULE,"Direct: ~p Result: ~p",[Message,Term]),
{reply,wf:json([{eval,iolist_to_binary(render_actions(wf:actions()))}]),Req,State};

info(Message,Req,State) -> {unknown,Message,Req,State}.
Expand Down

0 comments on commit 0b8ef0f

Please sign in to comment.