These are chat archives for synrc/n2o

23rd
Jun 2016
Andy
@m-2k
Jun 23 2016 08:32
@cystbear в Tompson_Chezarini_Programmirovanie_v_Erlang.pdf есть глава 16. Взаимодействие с другими языками программирования
skatt
@skatt
Jun 23 2016 23:30
I want to trigger an event on a page from a process outside all context. i.e. Another app updates a feed in kvs then tells a page that lists that feed to add the new entry to the list element for all users that are active on that page.
How do I do that?
Andy
@m-2k
Jun 23 2016 23:35
wf:update/2,wf:wire/1 or in n2o.js recieve raw messages
var $bin = {}; $bin.on = function onbin(r, cb) { if (is(r,2,'bin')) { if (typeof cb == 'function') cb(r); return { status: "ok" }; } else return { status: '' }; }
Define cb fun and catch messages if u want
Goo night
zzZ
Andy
@m-2k
Jun 23 2016 23:41
If u want insert item into page, can be use wf:insert_top/2
skatt
@skatt
Jun 23 2016 23:41
The function that updates the DB is not in n2o, so there is no CTx.
Do I spawn and wf:reg a loop then send to loop first?
Andy
@m-2k
Jun 23 2016 23:42
wf:reg, wf:send
skatt
@skatt
Jun 23 2016 23:43
Thank you.
Andy
@m-2k
Jun 23 2016 23:43
Use PubSub or die
skatt
@skatt
Jun 23 2016 23:43
:P
Andy
@m-2k
Jun 23 2016 23:43
n2o_mq.erl
skatt
@skatt
Jun 23 2016 23:44
If I do wf:reg in event(init) will wf:send = Mod:event(E)?
Andy
@m-2k
Jun 23 2016 23:44
put wf:reg into event(init) and unreg in event(terminate)
skatt
@skatt
Jun 23 2016 23:46

event(init) ->
wf:reg(index);
event(terminate) ->
wf:unreg(index);
event(E) -> stuff_and_things.

wf:send(index, stuff).

?
Andy
@m-2k
Jun 23 2016 23:46
wf:send(Pool,{server,Event}), event({server,Evt}). Read official book
skatt
@skatt
Jun 23 2016 23:46
AHHH!
Thanks
I knew I forgot something.
Andy
@m-2k
Jun 23 2016 23:46
Or Pid ! {server,Evt}
server, client, bin, etc..