localbus - Printable Version +- Logic Machine Forum (https://forum.logicmachine.net) +-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1) +--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8) +--- Thread: localbus (/showthread.php?tid=2762) |
localbus - benanderson_475 - 31.07.2020 hi , i am trying to work with localbus but i don't receive any logs from the groupcallback function, i want to monitor several obj in a resident script. in the attached i can see the handlers table but also udp{unconnected} maybe this is my problem ?? Code: lb = require('localbus').new() RE: localbus - fleeceable - 31.07.2020 Hi! Does script engine gives you any errors? Check that on error log... RE: localbus - admin - 31.07.2020 You need to call step for it to receive data. You should also define callback before setting it. Code: if not lb then RE: localbus - benanderson_475 - 01.08.2020 (31.07.2020, 08:35)admin Wrote: You need to call step for it to receive data. You should also define callback before setting it.Many Thanks RE: localbus - Svanda - 13.11.2020 (31.07.2020, 08:35)admin Wrote: You need to call step for it to receive data. You should also define callback before setting it.Hello Admin, can I ask you for documentation for localbus library? We are confusing what happens with queue if is too long? Can get somehow batch of e.g. ten telegrams in one step? Can we filter somehow range of group addresess to listen? What is return value of lb.step? Thanks a lot! RE: localbus - admin - 13.11.2020 There's no documentation because localbus is not needed for most users. Quote:We are confusing what happens with queue if is too long?If the queue is too long then new message will be dropped. Quote:Can get somehow batch of e.g. ten telegrams in one step?You can use lb:loop(timeout) to loop for a certain time. For this to work correctly you should set default timeout to a smaller value when creating localbus socket via new(timeout). Quote:Can we filter somehow range of group addresess to listen?Localbus will receive all messages anyway so you need to filter groups manually in callback functions. Quote:What is return value of lb.step?step return true when any message was received or nil, error on timeout. If you want to correctly communicate with multiple sockets/timers the easiest way is to use copas. Here's how to wrap localbus socket into copas context: Code: copas.addserver(lb.sock, function() |