This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

localbus
#6
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()
  lb.sock = copas.wrap(lb.sock)
  while true do
    lb:step()
  end
end, 1)
Reply


Messages In This Thread
localbus - by benanderson_475 - 31.07.2020, 06:12
RE: localbus - by fleeceable - 31.07.2020, 08:33
RE: localbus - by admin - 31.07.2020, 08:35
RE: localbus - by benanderson_475 - 01.08.2020, 11:55
RE: localbus - by Svanda - 13.11.2020, 09:56
RE: localbus - by admin - 13.11.2020, 12:40

Forum Jump: