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.

eibd singleton
#1
Openrb, maybe you can consider creating eibd singleton which allows simple use it in scripts or apps?


e.g.

Code:
if not client then
  client = new EibdClient(listenerId, addressList, tagList, eventListener)
// or maybe something like this
  client = new EibdClient(clientId, eventListener)
end

client.step()


Such solution would simplify for the user this interface and could be more lightweight than creating separate deamons in separate scripts.

I know that preparing reliable solution for this task could be not so easy but you have all tools and this would simplify some examples, add some order and structure and would be easier to use especially for not advanced users.

Maybe you could introduce some new module into UI (like Scenes) for managing clients and their configurations (listened adressList, tagLists etc.) and in the script the user could only pass info which client he want use and pass eventListener to it and use .step() method?
Done is better than perfect
Reply
#2
I don't see how can it be more lightweight than using scripts. In most cases there's no big difference from event scripts apart from keeping local variable values between calls. Even with simplified API it will still be too complicated for most users. You can create a user library if you use this construct often.
Reply
#3
It will using script but restarting of script will not restart the eibd deamon and recreate addresses list. And you could easily reuse working eibd deamon in other script.

When I am thinking now that tag list could be enough (it is well known interface but only it is not so much convenient in the UI when you have too much tags or longer names) but such UI tab should have possibility to create eibd deamon, connect it to the selected tag list and stop and start.

If it is about comparison between event-based script and resident+eibd of course keeping local variables is the main reason where it is chosen, choosing it is an optimisation used where there is a problem with performance of event-based (central statuses calculation is a good example for this).
Done is better than perfect
Reply


Forum Jump: